protected class GenericDatabaseInterface.GenericPreparedDatabaseStatement extends java.lang.Object implements DatabaseInterface.PreparedDatabaseStatement
Modifier and Type | Field and Description |
---|---|
private java.sql.Connection |
connection |
private int |
numRetries |
private java.util.ArrayList<Tuples.T2<java.lang.Integer,java.lang.Object>> |
params |
private java.lang.String |
query |
private java.sql.PreparedStatement |
statement |
Constructor and Description |
---|
GenericPreparedDatabaseStatement(java.lang.String query) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this prepared statement, indicating that it will not be needed
anymore and any resources related to it can be released.
|
DatabaseInterface.Rows |
executeQuery()
Executes this prepared statement as a query and returns the
query results.
|
int |
executeUpdate()
Executes this prepared statement as an update statement.
|
private void |
openConnection() |
void |
setBoolean(int paramIndex,
boolean o) |
void |
setDouble(int paramIndex,
double o) |
void |
setFloat(int paramIndex,
float o) |
void |
setInt(int paramIndex,
int o) |
void |
setLong(int paramIndex,
long o) |
void |
setNull(int paramIndex,
int type) |
void |
setParam(int paramIndex,
java.lang.Object param,
int paramType)
Sets a parameter of the prepared statement.
|
void |
setShort(int paramIndex,
short o) |
void |
setString(int paramIndex,
java.lang.String o) |
private java.lang.String query
private java.util.ArrayList<Tuples.T2<java.lang.Integer,java.lang.Object>> params
private java.sql.Connection connection
private java.sql.PreparedStatement statement
private int numRetries
public GenericPreparedDatabaseStatement(java.lang.String query)
private void openConnection() throws java.sql.SQLException
java.sql.SQLException
public void close()
DatabaseInterface.PreparedDatabaseStatement
close
in interface DatabaseInterface.PreparedDatabaseStatement
public DatabaseInterface.Rows executeQuery() throws java.sql.SQLException
DatabaseInterface.PreparedDatabaseStatement
executeQuery
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public int executeUpdate() throws java.sql.SQLException
DatabaseInterface.PreparedDatabaseStatement
executeUpdate
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setParam(int paramIndex, java.lang.Object param, int paramType) throws java.sql.SQLException
DatabaseInterface.PreparedDatabaseStatement
setParam
in interface DatabaseInterface.PreparedDatabaseStatement
paramIndex
- The index of the parameter to set.param
- The value of the parameter.paramType
- The type of the parameter, as set in java.sql.Types.java.sql.SQLException
public void setBoolean(int paramIndex, boolean o) throws java.sql.SQLException
setBoolean
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setDouble(int paramIndex, double o) throws java.sql.SQLException
setDouble
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setFloat(int paramIndex, float o) throws java.sql.SQLException
setFloat
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setInt(int paramIndex, int o) throws java.sql.SQLException
setInt
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setLong(int paramIndex, long o) throws java.sql.SQLException
setLong
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setNull(int paramIndex, int type) throws java.sql.SQLException
setNull
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setShort(int paramIndex, short o) throws java.sql.SQLException
setShort
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
public void setString(int paramIndex, java.lang.String o) throws java.sql.SQLException
setString
in interface DatabaseInterface.PreparedDatabaseStatement
java.sql.SQLException
Copyright 2004-2015 Wandora Team