public class ParameterizedStatement extends java.lang.Object implements IStatement
PreparedStatement
.Constructor and Description |
---|
ParameterizedStatement(java.lang.String SQL,
java.sql.Connection connection,
java.util.List parameters)
Create a new instance; the parameters list is copied.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying statement, and nulls the reference to it.
|
java.sql.ResultSet |
executeQuery()
Executes the statement as a query, returning a
ResultSet . |
int |
executeUpdate()
Executes the statement as an update, returning the number of rows
affected.
|
java.lang.String |
getSQL()
Returns the SQL associated with this statement.
|
java.sql.Statement |
getStatement()
Returns the underlying or
PreparedStatement . |
java.lang.String |
toString() |
public ParameterizedStatement(java.lang.String SQL, java.sql.Connection connection, java.util.List parameters) throws java.sql.SQLException
SQL
- the SQL to execute (see Connection.prepareStatement(java.lang.String)
)connection
- the JDBC connection to useparameters
- list of IParameter
java.sql.SQLException
public java.lang.String getSQL()
getSQL
in interface IStatement
public java.sql.Statement getStatement()
PreparedStatement
.getStatement
in interface IStatement
public void close() throws java.sql.SQLException
close
in interface IStatement
java.sql.SQLException
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
ResultSet
.executeQuery
in interface IStatement
java.sql.SQLException
public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface IStatement
java.sql.SQLException
public java.lang.String toString()
toString
in class java.lang.Object