You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@empire-db.apache.org by Daniel Weidele <da...@gmail.com> on 2016/07/15 18:01:58 UTC

Prepared Statements

Dear group,

what is the use of the prepared statements mechanism when, as it appears to
me, the prepared statement is recreated with every call of
"db.executeInsert(cmd, conn);"?

In particular DBDatabaseDriver.class:541 to DBDatabaseDriver.class:547 do
not "reuse" any prepared statement, but a new prepared statement is
requested from the connection.

Am I using it correctly?

DBCmdParam myParam = myCmd.addParam(...);
for (String value : myValues)
{
 myParam.setValue(value);
 db.executeInsert(myCmd, myConn);
}

Thanks for help,
Daniel