public class CachedPreparedStatement extends Object implements Callable<PreparedStatement>, Closeable
PreparedStatement
.Constructor and Description |
---|
CachedPreparedStatement(Connection dbc,
String sql)
Create a new cached prepared statement.
|
Modifier and Type | Method and Description |
---|---|
PreparedStatement |
call()
Get the prepared statement, creating one if necessary.
|
void |
close()
Close the prepared statement.
|
public CachedPreparedStatement(Connection dbc, String sql)
dbc
- The database connection.sql
- The SQL string.public PreparedStatement call() throws SQLException
call
in interface Callable<PreparedStatement>
SQLException
- if there is an error preparing the statement.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if there is an error closing the statement.