uk.org.ogsadai.activity.sql.statement
Class SimpleSQLStatement

java.lang.Object
  |
  +--uk.org.ogsadai.activity.sql.statement.SimpleSQLStatement
All Implemented Interfaces:
SQLStatement

public class SimpleSQLStatement
extends java.lang.Object
implements SQLStatement

Executes simple SQL queries.

Author:
The OGSA-DAI Project Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.sql.Connection mConnection
          JDBC connection handler
private  java.lang.String mExpression
          SQL expression
private  boolean mFinishedProcessing
          Has expression completed (default false)
private  java.sql.Statement mStatement
          JDBC statement handler
 
Constructor Summary
SimpleSQLStatement()
          Constructor
 
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
 java.lang.String getExpression()
          Gets SQL expression
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mStatement

private java.sql.Statement mStatement
JDBC statement handler


mConnection

private java.sql.Connection mConnection
JDBC connection handler


mExpression

private java.lang.String mExpression
SQL expression


mFinishedProcessing

private boolean mFinishedProcessing
Has expression completed (default false)

Constructor Detail

SimpleSQLStatement

public SimpleSQLStatement()
Constructor

Method Detail

initialise

public void initialise()
                throws java.sql.SQLException
Description copied from interface: SQLStatement
Initialise the SQL statement.

Specified by:
initialise in interface SQLStatement
Throws:
java.sql.SQLException - If any problem occurs in the driver.

setConnection

public void setConnection(java.sql.Connection connection)
Description copied from interface: SQLStatement
Set the connection for this SQL statement

Specified by:
setConnection in interface SQLStatement
Parameters:
connection - JDBC connection

setExpression

public void setExpression(java.lang.String expression)
Description copied from interface: SQLStatement
Set the expression for this SQL statement

Specified by:
setExpression in interface SQLStatement
Parameters:
expression - SQL expression

getExpression

public java.lang.String getExpression()
Gets SQL expression

Returns:
expression

setParameters

public void setParameters(ParameterList parameters)
Description copied from interface: SQLStatement
Set the parameters for this SQL statement

Specified by:
setParameters in interface SQLStatement
Parameters:
parameters - List of parameters

close

public void close()
           throws java.sql.SQLException
Description copied from interface: SQLStatement
Closes this SQL statement.

Specified by:
close in interface SQLStatement
Throws:
java.sql.SQLException - If any problem occurs in the driver.

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException,
                                       MissingParametersException,
                                       ParameterAccessException
Description copied from interface: SQLStatement
Executes this SQL statement

Specified by:
executeQuery in interface SQLStatement
Returns:
a ResultSet or null if there are no more parameters to process.
Throws:
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.
java.sql.SQLException - If any problem occurs in the driver.

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException,
                         MissingParametersException,
                         ParameterAccessException
Description copied from interface: SQLStatement
Executes this SQL statement as an update

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