Subject | Re: [Firebird-Java] BatchUpdateException when ex ecuting PreparedStatements with executeBatch |
---|---|
Author | Mark Rotteveel |
Post date | 2016-09-02T19:19:33Z |
Please show your code and the entire stacktrace.
Mark
----- Bericht beantwoorden -----
Van: "andreschuetz@... [Firebird-Java]" <Firebird-Java@yahoogroups.com>
Aan: <Firebird-Java@yahoogroups.com>
Onderwerp: [Firebird-Java] BatchUpdateException when executing PreparedStatements with executeBatch
Datum: vr, sep. 2, 2016 15:16
Van: "andreschuetz@... [Firebird-Java]" <Firebird-Java@yahoogroups.com>
Aan: <Firebird-Java@yahoogroups.com>
Onderwerp: [Firebird-Java] BatchUpdateException when executing PreparedStatements with executeBatch
Datum: vr, sep. 2, 2016 15:16
Hello,
I use the following specifications as development environment:
- Ubuntu OS
- Scala 2.11.8
- Firebird 2.5
- "org.firebirdsql.jdbc" % "jaybird-jdk18" % "2.2.11"
I try to execute an "INSERT" PreparedStatement with the executeBatch method. The PreparedStatement is the following:
- "INSERT INTO accounts (id, name, description, birthday, salary) VALUES(?, ?, ?, ?, ?)"
The values for one batch are set with the appropriate methods (setLong, setString, setDate, etc) and are as follows:
- id: 1
- name: Max Mustermann
- description: Fancy Shit
- birthday: 1983-01-12
- salary: 1500.23
After executing the PreparedStatement with "executeBatch",
I get the following error message:
java.sql.BatchUpdateException
at org.firebirdsql.jdbc.AbstractPreparedStatement.executeBatch(AbstractPreparedStatement.java:941)
There is no additional information that explains the reason for this error.
Regarding to the jaybird documentation on the firebird website, the PreparedStatement is correct and "executeBatch" is implemented and usable.
Can anybody get me a hint?