org.histpop.server.db
Class PreparedSQL

java.lang.Object
  extended by org.histpop.server.db.PreparedSQL

public class PreparedSQL
extends java.lang.Object


Constructor Summary
PreparedSQL(java.lang.String name, java.lang.String query, SQLRepository db)
          This constructor build a prepared SQL query from a query String, using a given repository.
 
Method Summary
 void bind(java.util.Hashtable values)
           
 void bind(java.lang.Object[] values)
           
 java.util.Vector executeQuery()
          This method executes the query and returns the resulting list as a Vector of objects whose type is determined by the resultType parameter
 int executeUpdate()
          This method executes an update query and returns the number of rows updated
 void set(int pos, java.lang.Object value)
           
 void setResultType(java.lang.String type)
          This methods sets the return type of the result
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PreparedSQL

public PreparedSQL(java.lang.String name,
                   java.lang.String query,
                   SQLRepository db)
            throws ServerException
This constructor build a prepared SQL query from a query String, using a given repository.

Throws:
ServerException
Method Detail

setResultType

public void setResultType(java.lang.String type)
This methods sets the return type of the result


set

public void set(int pos,
                java.lang.Object value)
         throws ServerException
Throws:
ServerException

executeUpdate

public int executeUpdate()
                  throws ServerException
This method executes an update query and returns the number of rows updated

Throws:
ServerException

executeQuery

public java.util.Vector executeQuery()
                              throws ServerException
This method executes the query and returns the resulting list as a Vector of objects whose type is determined by the resultType parameter

Throws:
ServerException

bind

public void bind(java.util.Hashtable values)
          throws ServerException
Throws:
ServerException

bind

public void bind(java.lang.Object[] values)
          throws ServerException
Throws:
ServerException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object