org.objectweb.telosys.dal.dao
Class QueryContext

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.dal.dao.QueryContext

public class QueryContext
extends TelosysObject


Field Summary
static boolean RETURN_GENERATED_KEYS
           
 
Constructor Summary
QueryContext(java.sql.Connection con, java.lang.String sSql)
           
QueryContext(java.sql.Connection con, java.lang.String sSql, boolean bReturnGeneratedKeys)
           
 
Method Summary
protected  void close()
           
protected  java.lang.Long executeInsertKeyGen()
          Executes an INSERT with KEY GENERATION ( Autoincrement Key )
protected  java.sql.ResultSet executeQuery()
           
protected  int executeUpdate()
           
 java.math.BigDecimal getResultBigDecimal(int iPosition)
           
 java.sql.Blob getResultBlob(int iPosition)
           
 byte[] getResultBlobAsByteArray(int iPosition)
           
 boolean getResultBoolean(int iPosition)
           
 boolean getResultBooleanFromInt(int iPosition, int iTrueValue)
           
 boolean getResultBooleanFromString(int iPosition, java.lang.String sTrueValue)
           
 java.lang.Boolean getResultBooleanObject(int iPosition)
           
 byte getResultByte(int iPosition)
           
 java.lang.Byte getResultByteObject(int iPosition)
           
 byte[] getResultBytes(int iPosition)
           
 java.sql.Clob getResultClob(int iPosition)
           
 java.util.Date getResultDate(int iPosition)
           
 java.sql.Date getResultDateSql(int iPosition)
           
 double getResultDouble(int iPosition)
           
 java.lang.Double getResultDoubleObject(int iPosition)
           
 float getResultFloat(int iPosition)
           
 java.lang.Float getResultFloatObject(int iPosition)
           
 int getResultInt(int iPosition)
           
 java.lang.Integer getResultIntObject(int iPosition)
           
 long getResultLong(int iPosition)
           
 java.lang.Long getResultLongObject(int iPosition)
           
 short getResultShort(int iPosition)
           
 java.lang.Short getResultShortObject(int iPosition)
           
 java.lang.String getResultString(int iPosition)
           
 java.sql.Time getResultTime(int iPosition)
           
 java.util.Date getResultTimeAsDate(int iPosition)
           
 java.sql.Timestamp getResultTimestamp(int iPosition)
           
 java.util.Date getResultTimestampAsDate(int iPosition)
           
protected  boolean nextResult()
           
 void setParamBigDecimal(int i, java.math.BigDecimal value)
           
 void setParamBlob(int i, java.sql.Blob param)
           
 void setParamBlob(int i, byte[] bytes)
           
 void setParamBoolean(int i, boolean bValue)
           
 void setParamBoolean(int i, java.lang.Boolean obj)
           
 void setParamBooleanAsInt(int i, boolean bValue, int iTrueValue, int iFalseValue)
           
 void setParamBooleanAsString(int i, boolean bValue, java.lang.String sTrueValue, java.lang.String sFalseValue)
           
 void setParamByte(int i, byte value)
           
 void setParamByte(int i, java.lang.Byte obj)
           
 void setParamBytes(int i, byte[] bytes)
           
 void setParamClob(int i, java.sql.Clob param)
           
 void setParamDate(int i, java.util.Date dateValue)
          Converts the given java.util.Date to java.sql.Date and set it as Date parameter
 void setParamDouble(int i, double dValue)
           
 void setParamDouble(int i, java.lang.Double obj)
           
 void setParamFloat(int i, float fValue)
           
 void setParamFloat(int i, java.lang.Float obj)
           
 void setParamInt(int i, int iValue)
           
 void setParamInt(int i, java.lang.Integer obj)
           
 void setParamLong(int i, long value)
           
 void setParamLong(int i, java.lang.Long obj)
           
 void setParamShort(int i, short value)
           
 void setParamShort(int i, java.lang.Short obj)
           
 void setParamString(int i, java.lang.String sValue)
           
 void setParamTime(int i, java.util.Date dateValue)
          Converts the given java.util.Date to java.sql.Time and set it as Time parameter
 void setParamTime(int i, java.sql.Time time)
           
 void setParamTimestamp(int i, java.util.Date dateValue)
          Converts the given java.util.Date to java.sql.Timestamp and set it as Timestamp parameter
 void setParamTimestamp(int i, java.sql.Timestamp timestamp)
           
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETURN_GENERATED_KEYS

public static final boolean RETURN_GENERATED_KEYS
See Also:
Constant Field Values
Constructor Detail

QueryContext

public QueryContext(java.sql.Connection con,
                    java.lang.String sSql)
             throws java.sql.SQLException

QueryContext

public QueryContext(java.sql.Connection con,
                    java.lang.String sSql,
                    boolean bReturnGeneratedKeys)
             throws java.sql.SQLException
Method Detail

executeUpdate

protected int executeUpdate()
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

executeQuery

protected java.sql.ResultSet executeQuery()
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

executeInsertKeyGen

protected java.lang.Long executeInsertKeyGen()
                                      throws java.sql.SQLException
Executes an INSERT with KEY GENERATION ( Autoincrement Key )

Returns:
Throws:
java.sql.SQLException

close

protected void close()

setParamInt

public void setParamInt(int i,
                        int iValue)
                 throws TelosysException
Throws:
TelosysException

setParamInt

public void setParamInt(int i,
                        java.lang.Integer obj)
                 throws TelosysException
Throws:
TelosysException

setParamByte

public void setParamByte(int i,
                         byte value)
                  throws TelosysException
Throws:
TelosysException

setParamByte

public void setParamByte(int i,
                         java.lang.Byte obj)
                  throws TelosysException
Throws:
TelosysException

setParamShort

public void setParamShort(int i,
                          short value)
                   throws TelosysException
Throws:
TelosysException

setParamShort

public void setParamShort(int i,
                          java.lang.Short obj)
                   throws TelosysException
Throws:
TelosysException

setParamLong

public void setParamLong(int i,
                         long value)
                  throws TelosysException
Throws:
TelosysException

setParamLong

public void setParamLong(int i,
                         java.lang.Long obj)
                  throws TelosysException
Throws:
TelosysException

setParamFloat

public void setParamFloat(int i,
                          float fValue)
                   throws TelosysException
Throws:
TelosysException

setParamFloat

public void setParamFloat(int i,
                          java.lang.Float obj)
                   throws TelosysException
Throws:
TelosysException

setParamDouble

public void setParamDouble(int i,
                           double dValue)
                    throws TelosysException
Throws:
TelosysException

setParamDouble

public void setParamDouble(int i,
                           java.lang.Double obj)
                    throws TelosysException
Throws:
TelosysException

setParamBigDecimal

public void setParamBigDecimal(int i,
                               java.math.BigDecimal value)
                        throws TelosysException
Throws:
TelosysException

setParamString

public void setParamString(int i,
                           java.lang.String sValue)
                    throws TelosysException
Throws:
TelosysException

setParamDate

public void setParamDate(int i,
                         java.util.Date dateValue)
                  throws TelosysException
Converts the given java.util.Date to java.sql.Date and set it as Date parameter

Parameters:
i -
dateValue -
Throws:
TelosysException

setParamTimestamp

public void setParamTimestamp(int i,
                              java.util.Date dateValue)
                       throws TelosysException
Converts the given java.util.Date to java.sql.Timestamp and set it as Timestamp parameter

Parameters:
i -
dateValue -
Throws:
TelosysException

setParamTimestamp

public void setParamTimestamp(int i,
                              java.sql.Timestamp timestamp)
                       throws TelosysException
Throws:
TelosysException

setParamTime

public void setParamTime(int i,
                         java.util.Date dateValue)
                  throws TelosysException
Converts the given java.util.Date to java.sql.Time and set it as Time parameter

Parameters:
i -
dateValue -
Throws:
TelosysException

setParamTime

public void setParamTime(int i,
                         java.sql.Time time)
                  throws TelosysException
Throws:
TelosysException

setParamBytes

public void setParamBytes(int i,
                          byte[] bytes)
                   throws TelosysException
Throws:
TelosysException

setParamBoolean

public void setParamBoolean(int i,
                            boolean bValue)
                     throws TelosysException
Throws:
TelosysException

setParamBoolean

public void setParamBoolean(int i,
                            java.lang.Boolean obj)
                     throws TelosysException
Throws:
TelosysException

setParamBooleanAsString

public void setParamBooleanAsString(int i,
                                    boolean bValue,
                                    java.lang.String sTrueValue,
                                    java.lang.String sFalseValue)
                             throws TelosysException
Throws:
TelosysException

setParamBooleanAsInt

public void setParamBooleanAsInt(int i,
                                 boolean bValue,
                                 int iTrueValue,
                                 int iFalseValue)
                          throws TelosysException
Throws:
TelosysException

setParamClob

public void setParamClob(int i,
                         java.sql.Clob param)
                  throws TelosysException
Throws:
TelosysException

setParamBlob

public void setParamBlob(int i,
                         byte[] bytes)
                  throws TelosysException
Throws:
TelosysException

setParamBlob

public void setParamBlob(int i,
                         java.sql.Blob param)
                  throws TelosysException
Throws:
TelosysException

getResultString

public java.lang.String getResultString(int iPosition)
                                 throws TelosysException
Throws:
TelosysException

getResultInt

public int getResultInt(int iPosition)
                 throws TelosysException
Throws:
TelosysException

getResultIntObject

public java.lang.Integer getResultIntObject(int iPosition)
                                     throws TelosysException
Throws:
TelosysException

getResultByte

public byte getResultByte(int iPosition)
                   throws TelosysException
Throws:
TelosysException

getResultByteObject

public java.lang.Byte getResultByteObject(int iPosition)
                                   throws TelosysException
Throws:
TelosysException

getResultShort

public short getResultShort(int iPosition)
                     throws TelosysException
Throws:
TelosysException

getResultShortObject

public java.lang.Short getResultShortObject(int iPosition)
                                     throws TelosysException
Throws:
TelosysException

getResultLong

public long getResultLong(int iPosition)
                   throws TelosysException
Throws:
TelosysException

getResultLongObject

public java.lang.Long getResultLongObject(int iPosition)
                                   throws TelosysException
Throws:
TelosysException

getResultFloat

public float getResultFloat(int iPosition)
                     throws TelosysException
Throws:
TelosysException

getResultFloatObject

public java.lang.Float getResultFloatObject(int iPosition)
                                     throws TelosysException
Throws:
TelosysException

getResultDouble

public double getResultDouble(int iPosition)
                       throws TelosysException
Throws:
TelosysException

getResultDoubleObject

public java.lang.Double getResultDoubleObject(int iPosition)
                                       throws TelosysException
Throws:
TelosysException

getResultBigDecimal

public java.math.BigDecimal getResultBigDecimal(int iPosition)
                                         throws TelosysException
Throws:
TelosysException

getResultDate

public java.util.Date getResultDate(int iPosition)
                             throws TelosysException
Throws:
TelosysException

getResultDateSql

public java.sql.Date getResultDateSql(int iPosition)
                               throws TelosysException
Throws:
TelosysException

getResultTime

public java.sql.Time getResultTime(int iPosition)
                            throws TelosysException
Throws:
TelosysException

getResultTimeAsDate

public java.util.Date getResultTimeAsDate(int iPosition)
                                   throws TelosysException
Throws:
TelosysException

getResultTimestamp

public java.sql.Timestamp getResultTimestamp(int iPosition)
                                      throws TelosysException
Throws:
TelosysException

getResultTimestampAsDate

public java.util.Date getResultTimestampAsDate(int iPosition)
                                        throws TelosysException
Throws:
TelosysException

getResultBytes

public byte[] getResultBytes(int iPosition)
                      throws TelosysException
Throws:
TelosysException

getResultBoolean

public boolean getResultBoolean(int iPosition)
                         throws TelosysException
Throws:
TelosysException

getResultBooleanObject

public java.lang.Boolean getResultBooleanObject(int iPosition)
                                         throws TelosysException
Throws:
TelosysException

getResultBooleanFromInt

public boolean getResultBooleanFromInt(int iPosition,
                                       int iTrueValue)
                                throws TelosysException
Throws:
TelosysException

getResultBooleanFromString

public boolean getResultBooleanFromString(int iPosition,
                                          java.lang.String sTrueValue)
                                   throws TelosysException
Throws:
TelosysException

getResultClob

public java.sql.Clob getResultClob(int iPosition)
                            throws TelosysException
Throws:
TelosysException

getResultBlobAsByteArray

public byte[] getResultBlobAsByteArray(int iPosition)
                                throws TelosysException
Throws:
TelosysException

getResultBlob

public java.sql.Blob getResultBlob(int iPosition)
                            throws TelosysException
Throws:
TelosysException

nextResult

protected boolean nextResult()
                      throws TelosysException
Throws:
TelosysException