org.apache.tapestry.contrib.jdbc
Class ParameterizedStatement

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

public class ParameterizedStatement
extends Object
implements IStatement

A wrapper around PreparedStatement.

Version:
$Id: ParameterizedStatement.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
ParameterizedStatement(String SQL, Connection connection, 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.
 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.
 String getSQL()
          Returns the SQL associated with this statement.
 Statement getStatement()
          Returns the underlying or PreparedStatement.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterizedStatement

public ParameterizedStatement(String SQL,
                              Connection connection,
                              List parameters)
                       throws 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
Throws:
SQLException
Method Detail

getSQL

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

Specified by:
getSQL in interface IStatement

getStatement

public Statement getStatement()
Returns the underlying or PreparedStatement.

Specified by:
getStatement in interface IStatement

close

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

Specified by:
close in interface IStatement
Throws:
SQLException

executeQuery

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

Specified by:
executeQuery in interface IStatement
Throws:
SQLException

executeUpdate

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

Specified by:
executeUpdate in interface IStatement
Throws:
SQLException

toString

public String toString()
Overrides:
toString in class Object