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.SQLExceptionpublic void close()
DatabaseInterface.PreparedDatabaseStatementclose in interface DatabaseInterface.PreparedDatabaseStatementpublic DatabaseInterface.Rows executeQuery() throws java.sql.SQLException
DatabaseInterface.PreparedDatabaseStatementexecuteQuery in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic int executeUpdate()
                  throws java.sql.SQLException
DatabaseInterface.PreparedDatabaseStatementexecuteUpdate in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setParam(int paramIndex,
                     java.lang.Object param,
                     int paramType)
              throws java.sql.SQLException
DatabaseInterface.PreparedDatabaseStatementsetParam in interface DatabaseInterface.PreparedDatabaseStatementparamIndex - 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.SQLExceptionpublic void setBoolean(int paramIndex,
                       boolean o)
                throws java.sql.SQLException
setBoolean in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setDouble(int paramIndex,
                      double o)
               throws java.sql.SQLException
setDouble in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setFloat(int paramIndex,
                     float o)
              throws java.sql.SQLException
setFloat in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setInt(int paramIndex,
                   int o)
            throws java.sql.SQLException
setInt in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setLong(int paramIndex,
                    long o)
             throws java.sql.SQLException
setLong in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setNull(int paramIndex,
                    int type)
             throws java.sql.SQLException
setNull in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setShort(int paramIndex,
                     short o)
              throws java.sql.SQLException
setShort in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionpublic void setString(int paramIndex,
                      java.lang.String o)
               throws java.sql.SQLException
setString in interface DatabaseInterface.PreparedDatabaseStatementjava.sql.SQLExceptionCopyright 2004-2015 Wandora Team