Subject | |
---|---|
Author | Roman Rokytskyy |
Post date | 2003-11-14T21:43:57Z |
> statement.setObject(1,"1");This normal behaviour since driver is not required to serialize
> statement.setObject(2, new CustomClass());
> statement.executeUpdate();
> statement.close();
> connection.close();
> //////////////////////
> varchar_id has VARCHAR(32) type in database.
> blob_id has blob_field type in database.
> CustomClass is class written by us.
>
> That code throws TypeConvesionException.
>
> If its normal behaviour can somebody tell
> me how use that jdbc driver with JBoss.
objects to store them in blobs.
In JBoss you have to set up type mapping (I did this long time ago in
JBoss 2.x, do not know how to do this in 3.x) between your type and
database type. Normally JBoss' CMP will serialize your object into
byte[] and this will be stored in database by driver. Try to ask in
JBoss forums how to set up mapping correctly.
Code above has to be modified to serialize your object into byte[],
then you can use setObject(...) method.
Best regards,
Roman Rokytskyy