I was just wondering if it would make sense to change JDBCDescriptorsStore
to make it
much more efficient, by changing where the prepared statements are being
created and closed, here
is an example....
from createObject:
// Inserting children
Enumeration children = object.enumerateChildren();
while (children.hasMoreElements()) {
statement = connection.prepareStatement
("insert into children values(?,?)");
statement.setString(1, uri.toString());
statement.setString(2, (String) children.nextElement());
statement.execute();
closeStatement(statement);
}
Change to
// Inserting children
statement = null;
Enumeration children = object.enumerateChildren();
while (children.hasMoreElements()) {
if (statement == null){
statement = connection.prepareStatement
("insert into children values(?,?)");
}
statement.setString(1, uri.toString());
statement.setString(2, (String) children.nextElement());
statement.execute();
}
closeStatement(statement);
I have done this for the while file and posted it on our website at:
http://www.jcafeinc.com/jdbcdescriptorsstore.java
I can't test it, because I am not set up to, but if someone could, this
could dramatically improve
the speed of these methods.