Hi All,
I am trying to insert some records into a table using the Universal
JDBC Driver. When I go to execute the prepared statement I get the following error:
com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -7008, SQLSTATE: 55019, SQLERRMC: TABLE1 ;LIBRARY ;3
SQL State 55019 is 'The table is in an invalid state for the operation.' From the info I've found, this problem seems to relate to journaling. The physical file I want to insert records into is not journaled (and I don't want it to be). A proposed solution has been to turn off commitment control (ie. use Connection.setAutoCommit(false)) but this doesn't work either.
Example code that gives the error:
//...set up url, username, password.
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
Connection con = DriverManager.getConnection(url,username,password);
con.setAutoCommit(false);
String SQL = "insert into LIBRARY.TABLE1 values(?,?)";
PreparedStatement ps = con.prepareStatement(SQL);
ps.setString(1,"A");
ps.setString(2,"B");
ps.executeUpdate(); // Fails on this line.
con.commit();
I have used similar code for select statements and they work fine. I only get the problem for insert/update/delete.
Can someone please help?