org.apache.tapestry.contrib.jdbc
Class ParameterizedStatement

java.lang.Object
  extended byorg.apache.tapestry.contrib.jdbc.ParameterizedStatement
All Implemented Interfaces:
IStatement

public class ParameterizedStatement
extends java.lang.Object
implements IStatement

A wrapper around PreparedStatement.

Author:
Howard Lewis Ship

Constructor Summary
ParameterizedStatement(java.lang.String SQL, java.sql.Connection connection, java.util.List parameters)
          Create a new instance; the parameters list is copied.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterizedStatement

public ParameterizedStatement(java.lang.String SQL,
                              java.sql.Connection connection,
                              java.util.List parameters)
                       throws java.sql.SQLException
Create a new instance; the parameters list is copied.

Parameters:
SQL - the SQL to execute (see Connection.prepareStatement(java.lang.String))
connection - the JDBC connection to use
parameters - list of IParameter
Method Detail

getSQL

public java.lang.String getSQL()
Returns the SQL associated with this statement.

Specified by:
getSQL in interface IStatement

getStatement

public java.sql.Statement getStatement()
Returns the underlying or PreparedStatement.

Specified by:
getStatement in interface IStatement

close

public void close()
           throws java.sql.SQLException
Closes the underlying statement, and nulls the reference to it.

Specified by:
close in interface IStatement
Throws:
java.sql.SQLException

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException
Executes the statement as a query, returning a ResultSet.

Specified by:
executeQuery in interface IStatement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Executes the statement as an update, returning the number of rows affected.

Specified by:
executeUpdate in interface IStatement
Throws:
java.sql.SQLException

toString

public java.lang.String toString()