uk.org.ogsadai.activity.sql.statement
Interface SQLStatement

All Known Implementing Classes:
ParameterisedSQLStatement, SimpleSQLStatement

public interface SQLStatement

Interface for SQL statement-related activities.

Author:
The OGSA-DAI Project Team.

Method Summary
 void close()
          Closes this SQL statement.
 java.sql.ResultSet executeQuery()
          Executes this SQL statement
 int executeUpdate()
          Executes this SQL statement as an update
 void initialise()
          Initialise the SQL statement.
 void setConnection(java.sql.Connection connection)
          Set the connection for this SQL statement
 void setExpression(java.lang.String expression)
          Set the expression for this SQL statement
 void setParameters(ParameterList parameters)
          Set the parameters for this SQL statement
 

Method Detail

setConnection

public void setConnection(java.sql.Connection connection)
Set the connection for this SQL statement

Parameters:
connection - JDBC connection

setExpression

public void setExpression(java.lang.String expression)
Set the expression for this SQL statement

Parameters:
expression - SQL expression

setParameters

public void setParameters(ParameterList parameters)
Set the parameters for this SQL statement

Parameters:
parameters - List of parameters

initialise

public void initialise()
                throws java.sql.SQLException
Initialise the SQL statement.

Throws:
java.sql.SQLException - If any problem occurs in the driver.

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException,
                                       MissingParametersException,
                                       ParameterAccessException
Executes this SQL statement

Returns:
a ResultSet or null if there are no more parameters to process.
Throws:
java.sql.SQLException - If any problem occurs in the driver.
MissingParametersException - If some of the parameters provided all their values yet others did not.
ParameterAccessException - If there is a problem when accessing a parameter value.

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException,
                         MissingParametersException,
                         ParameterAccessException
Executes this SQL statement as an update

Returns:
an update count or -1 if there are no more parameters to process
Throws:
java.sql.SQLException - If any problem occurs in the driver.
MissingParametersException - If some of the parameters provided all their values yet others did not.
ParameterAccessException - If there is a problem when accessing a parameter value.

close

public void close()
           throws java.sql.SQLException
Closes this SQL statement.

Throws:
java.sql.SQLException - If any problem occurs in the driver.