Here is how I connect to the database :
String url = "jdbc:derby:"+purl+pdbname+";create="+cancreatedb;
String driver = "org.apache.derby.jdbc.EmbeddedDriver";
Class.forName(driver);
con = DriverManager.getConnection(url, user, passwd);
con.setAutoCommit(false);
And here is how I execute sql statements :
// I create the prepared statement only once :
psInsert = dbgencon.getConnection().prepareStatement("INSERT INTO data
(numvign, data) VALUES (?, ?)");
...
// I configure the statement and execute it
psInsert.setInt(1, numvign);
psInsert.setBytes(2, DBGenConnection.obj2Bytes(jv));
int n = psInsert.executeUpdate();
When I comment the last line I haven't got the
java.lang.OutOfMemoryError
Maybe it important to say that I use 2 derby connexion into the same
application. And I do lots of insert into the two one.
thanks for any help :)