Subject | How2 save javaobject in Firebird ? |
---|---|
Author | mozheyko_d |
Post date | 2004-12-17T12:08:16Z |
Hi all !
I need to save java-object in Firebird database
I use:
FirebirdSS-1.5.1 - Linux server
FirebirdSQL-1.5.5JDK1.4 - JDBC driver
Table:
create table a(
id integer not null primary key,
rawdata blob
);
insert code:
[code]
...
PreparedStatement statement = connection.prepareStatement("insert
into a values(?, ?);");
Object o = new SomeObject();
statement.setObject(1, 1);
statement.setObject(2, o);
statement.executeUpdate();
...
[/code]
throws exception:
[code]
org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to object.
at org.firebirdsql.jdbc.field.FBField.setObject(FBField.java:741)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.setObject(AbstractPreparedStatement.java:218)
at Test.main(Test.java:37)
[/code]
I need to save java-object in Firebird database
I use:
FirebirdSS-1.5.1 - Linux server
FirebirdSQL-1.5.5JDK1.4 - JDBC driver
Table:
create table a(
id integer not null primary key,
rawdata blob
);
insert code:
[code]
...
PreparedStatement statement = connection.prepareStatement("insert
into a values(?, ?);");
Object o = new SomeObject();
statement.setObject(1, 1);
statement.setObject(2, o);
statement.executeUpdate();
...
[/code]
throws exception:
[code]
org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to object.
at org.firebirdsql.jdbc.field.FBField.setObject(FBField.java:741)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.setObject(AbstractPreparedStatement.java:218)
at Test.main(Test.java:37)
[/code]