java - IBM DB2 JDBC over ODBC: SQLException thrown when running delete on empty table -
i'm accessing ibm db2 datatable available odbc datasource, using sun.jdbc.odbc.jdbcodbcdriver driver.
the problem i've encountered is, when i'm executing delete table using java.sql.statement.executeupdate(string), , table empty, java.sql.sqlexception thrown (the expected behaviour 0 should returned). exception message "no data found".
it's first contact ibm db2, question is, expected behaviour on database? or can configured on database level? or odbc-specific thing?
if standard behaviour, how should recognize 'exception' real exceptions? don't parsing exception messages business logic, if necessary, can expect, "no data found"?
i've tried google specification of behaviour, i've found no documentation case.
this normal. db2 did not found delete, , return warning.
many databases have same status: sqlstate 02000. take in google , see other rdbm have same code. however, db2 has sqlcode explain reason, , sqlstate, corresponding code sql0100w.
you have deal behaviour while working db2, sqlwarning (the w @ end of sqlcode).
for next time, take @ sqlcode. find problem while working db2.
Comments
Post a Comment