public class PrepStatementHolder
extends java.lang.Object
Constructor and Description |
---|
PrepStatementHolder(java.lang.String stmtString)
Constructs a new prepared statement holder.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the prepared statement if it ever has been build.
|
java.sql.PreparedStatement |
getPreparedStatement(java.sql.Connection connection)
Returns a valid prepared statement matching to the connection as specified.
|
java.sql.PreparedStatement |
getPreparedStatement(ConnectionHolder connectionHolder)
Returns a valid prepared statement by checking if connection has not been closes, e.g. by timeout condition.
|
public PrepStatementHolder(java.lang.String stmtString)
stmtString
- the string to use to build the prepared statement.public java.sql.PreparedStatement getPreparedStatement(ConnectionHolder connectionHolder) throws java.sql.SQLException
connectionHolder
- the connection holder whose connection is to be used to create the prepared statementjava.sql.SQLException
public java.sql.PreparedStatement getPreparedStatement(java.sql.Connection connection) throws java.sql.SQLException
connection
- the connection to use to create the prepared statementjava.sql.SQLException
public void close()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de