views:

172

answers:

1

I am using JdbcTemplate.queryForInt to insert a Row into the DB, and then get the ID back.

The Query is "INSERT INTO metadocs(NAME) values (?) RETURNING METADOCID". If I run the statement in Flamerobin, it works fine.

However, if I run it from Java, I get the following error:

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO metadocs(NAME) values (?) RETURNING METADOCID]; SQL state [HY000]; error code [335544364]; GDS Exception. 335544364. request synchronization error; nested exception is org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544364. request synchronization error

Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544364. request synchronization error

Does anyone have an idea what this could be caused by?

A: 

Unlike Oracle, I'm not sure that the Jaybird JDBC driver supports the RETURNING syntax. Alternatively, you might look at the getGeneratedKeys() method , discussed here.

trashgod
I verified that firebird supports the "RETURNING"-clause - but the JDBC driver does not :-(
Flyhard
I appreciate the feed back. Any luck with `getGeneratedKeys()`?
trashgod