2

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?

Hugues Van Landeghem
  • 6,755
  • 3
  • 34
  • 59
Flyhard
  • 544
  • 5
  • 26

1 Answers1

0

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.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045