Hello all,
I have a java project that creates a database using more than one connections and I get the following error:
22000!07003:EXEC: no prepared statement with id: 1
Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
Connection con1 = DriverManager.getConnection("jdbc:monetdb://localhost/db1", "monetdb", "monetdb");
con1.setAutoCommit(true);
Connection con2 = DriverManager.getConnection("jdbc:monetdb://localhost/db1", "monetdb", "monetdb");
con2.setAutoCommit(true);
PreparedStatement ps2 = con2.prepareStatement("INSERT INTO table1 (a) VALUES (CAST(? AS INTEGER))");
ps2.setInt(1,1); ps2.addBatch();
Statement s1 = con1.createStatement();
s1.execute("CREATE TABLE table2 ( a INTEGER )");
s1.close();
ps2.executeBatch();