Methods Summary |
---|
public boolean | contains(java.lang.String sql)Checks to see if a pooled statement is available that
matches the specified SQL.
Stack stack;
if( !statements.containsKey(sql) ) {
return false;
}
stack = (Stack)statements.get(sql);
return !stack.empty();
|
public java.sql.PreparedStatement | pop(java.lang.String sql)Grabs a statement matching the specified SQL from the pool.
Stack stack = (Stack)statements.get(sql);
return (PreparedStatement)stack.pop();
|
public void | push(java.lang.String sql, java.sql.PreparedStatement stmt)Returns the statement with the specified SQL to the pool.
Stack stack;
if( statements.containsKey(sql) ) {
stack = (Stack)statements.get(sql);
}
else {
stack = new Stack();
statements.put(sql, stack);
}
stack.push(stmt);
|