|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.sql.statement.ParameterisedSQLStatement
Executes parameterised SQL statements.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
private static DAILogger |
LOG Logger object for logging in this class |
private java.sql.Connection |
mConnection JDBC connection handler |
private java.lang.String |
mExpression Parameterised SQL expression |
private boolean |
mFinishedProcessing Has expression completed (default false ) |
private ParameterList |
mParameters SQL expression parameters |
protected java.sql.PreparedStatement |
mStatement JDBC prepared statement handler |
private java.util.List |
mTempFileInputStreams Input streams that need to be closed when the query is executed |
private java.util.List |
mTempFiles Temporary files that need to be deleted when the query is executed |
Constructor Summary | |
ParameterisedSQLStatement() Constructor |
|
ParameterisedSQLStatement(java.sql.Connection conx, ParameterList parameters, java.lang.String expression) Constructor. |
Method Summary | |
void |
close() Closes this SQL statement. |
protected void |
closeTempFilesAndInputStreams() Cleans up any temporany files that were passed as parameters. |
java.sql.ResultSet |
executeQuery() Executes this SQL statement |
int |
executeUpdate() Executes this SQL statement as an update |
java.sql.Connection |
getConnection() Returns the JDBC connection handler. |
java.lang.String |
getExpression() Get the SQL expression |
ParameterList |
getParameters() Gets the parameters |
void |
initialise() Initialise the SQL statement. |
protected void |
prepareParameters() Adds parameters to the JDBC prepared statement handler. |
private void |
prepareParametersPrivate() Adds parameters to the JDBC prepared statement handler. |
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 |
private static final java.lang.String COPYRIGHT_NOTICE
private static DAILogger LOG
private java.sql.Connection mConnection
private ParameterList mParameters
private java.lang.String mExpression
protected java.sql.PreparedStatement mStatement
private boolean mFinishedProcessing
false
)
private java.util.List mTempFiles
private java.util.List mTempFileInputStreams
Constructor Detail |
public ParameterisedSQLStatement()
public ParameterisedSQLStatement(java.sql.Connection conx, ParameterList parameters, java.lang.String expression) throws java.sql.SQLException
conx
- JDBC connectionparameters
- A list of parametersexpression
- SQL expressionjava.sql.SQLException
- If the statement could not be preparedMethod Detail |
public void initialise() throws java.sql.SQLException
SQLStatement
initialise
in interface SQLStatement
java.sql.SQLException
- If any problem occurs in the driver.public void setConnection(java.sql.Connection connection)
SQLStatement
setConnection
in interface SQLStatement
connection
- JDBC connectionpublic java.sql.Connection getConnection()
public void setExpression(java.lang.String expression)
SQLStatement
setExpression
in interface SQLStatement
expression
- SQL expressionpublic java.lang.String getExpression()
public void setParameters(ParameterList parameters)
SQLStatement
setParameters
in interface SQLStatement
parameters
- List of parameterspublic ParameterList getParameters()
public void close() throws java.sql.SQLException
SQLStatement
close
in interface SQLStatement
java.sql.SQLException
- If any problem occurs in the driver.public java.sql.ResultSet executeQuery() throws java.sql.SQLException, MissingParametersException, ParameterAccessException
SQLStatement
executeQuery
in interface SQLStatement
ResultSet
or null
if there are no more parameters to process.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.public int executeUpdate() throws java.sql.SQLException, MissingParametersException, ParameterAccessException
SQLStatement
executeUpdate
in interface SQLStatement
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.protected void prepareParameters() throws java.sql.SQLException, MissingParametersException, ParameterAccessException
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.private void prepareParametersPrivate() throws java.sql.SQLException, MissingParametersException, ParameterAccessException
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.protected void closeTempFilesAndInputStreams()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |