Subject | Meaningful exception messages using batches |
---|---|
Author | DataCom - Diego |
Post date | 2004-04-13T21:12:16Z |
Hi all,
I am using firebird 1.5 with JBird 1.5 beta 3 for jdk 1.4 and noticed that,
when using batches, the SQL exceptions messages are much less meaningful.
Does anybody know if I am missing something? Follow an example...
I forced an error in a query and added it to a batch like this:
statement.addBatch(query);
statement.executeBatch();
When I run the program, the exception that is captured is the following:
java.sql.BatchUpdateException
at
org.firebirdsql.jdbc.AbstractStatement.executeBatch(AbstractStatement.java:9
09)
Wich is a very poor message and makes it impossible to discover what is
wrong with the queries. When I execute the same query using:
statement.executeUpdate(query);
I got the following exception:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL
Error
SQL error code = -204
Table unknown
TB___PROXIES
At line 1, column 21.
at
org.firebirdsql.jdbc.AbstractStatement.executeUpdate(AbstractStatement.java:
196)
As you can see, this message is much more descriptive. Couldnt the
executeBatch() exception bring a descriptive message as well? Is all that
right or there is something I am missing?
Thanks in advance,
DIEGO Moreira da Rosa
DataCom Telemática
Av França, 735 - Porto Alegre, RS - 90230-220
Fone: 51 3358 0112
Fax: 51 3358 0101
www.datacom-telematica.com.br
I am using firebird 1.5 with JBird 1.5 beta 3 for jdk 1.4 and noticed that,
when using batches, the SQL exceptions messages are much less meaningful.
Does anybody know if I am missing something? Follow an example...
I forced an error in a query and added it to a batch like this:
statement.addBatch(query);
statement.executeBatch();
When I run the program, the exception that is captured is the following:
java.sql.BatchUpdateException
at
org.firebirdsql.jdbc.AbstractStatement.executeBatch(AbstractStatement.java:9
09)
Wich is a very poor message and makes it impossible to discover what is
wrong with the queries. When I execute the same query using:
statement.executeUpdate(query);
I got the following exception:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL
Error
SQL error code = -204
Table unknown
TB___PROXIES
At line 1, column 21.
at
org.firebirdsql.jdbc.AbstractStatement.executeUpdate(AbstractStatement.java:
196)
As you can see, this message is much more descriptive. Couldnt the
executeBatch() exception bring a descriptive message as well? Is all that
right or there is something I am missing?
Thanks in advance,
DIEGO Moreira da Rosa
DataCom Telemática
Av França, 735 - Porto Alegre, RS - 90230-220
Fone: 51 3358 0112
Fax: 51 3358 0101
www.datacom-telematica.com.br