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