Another issue…

August 7, 2006

When attempting to map LONGVARBINARY(hsql) to BLOB(derby)…

An attempt was made to put a data value of type ‘java.lang.String’ into a data value of type ‘BLOB’.

Tried to convert the String to Byte Array. But clueless about inserting ByteArray into the table…      😦 😦 

Advertisements

3 Responses to “Another issue…”

  1. Jen said

    Hello!
    I am working on porting an Oracle database into a Derby one and have recently written a ‘database coping tool’ much like yours! Whilst searching the web I found blog and thought I could give you a hint on your string into blob question as I have just spent this morning trying to figure it out!!!

    String testString = “HELLO WORLD!”;
    java.io.ByteArrayInputStream bais = new java.io.ByteArrayInputStream (testString.getBytes());
    ps.setBinaryStream(1, bais, bais.available());

    (where ps is your Derby prepared statement)

  2. taurivalor said

    Thanks Jen…

    I will try out your solution and let you know the result..

    Thanks,
    Tauri.

  3. You stupid ass. This is a fantastic blog name. You got and have sat on it for over three years. Idiot. Click http://d2.ae/hool090745

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: