org.hydrateframework.sql
Class ParsedQuery

java.lang.Object
  extended by org.hydrateframework.sql.AbstractParameterStatement
      extended by org.hydrateframework.sql.ParsedQuery
All Implemented Interfaces:
java.sql.PreparedStatement, java.sql.Statement, NamedParameterStatement
Direct Known Subclasses:
QueryMap

public class ParsedQuery
extends AbstractParameterStatement

Version:
@(#)$Revision: 1.13 $
Author:
David Chamberlin

Nested Class Summary
protected static class ParsedQuery.QueryClause
          Holds details of a 'where' or 'select' clause
static class ParsedQuery.QueryClauseText
          This class is used to pass information about a query clause (where, set, values, parameter list) into this class.
static class ParsedQuery.SqlInfo
           
 
Nested classes/interfaces inherited from class org.hydrateframework.sql.AbstractParameterStatement
AbstractParameterStatement.Parameter
 
Field Summary
static int CLAUSE_DELETE
           
static int CLAUSE_DELETESET
           
static int CLAUSE_DELETEWHERE
           
static int CLAUSE_INSERT
           
static int CLAUSE_INSERTSET
           
static int CLAUSE_INSERTVALUES
           
static int CLAUSE_INSERTWHERE
           
static int CLAUSE_SELECT
           
static int CLAUSE_SELECTLIST
           
static int CLAUSE_SELECTPARAM
           
static int CLAUSE_SELECTWHERE
           
static int CLAUSE_STMTMASK
           
static int CLAUSE_UPDATE
           
static int CLAUSE_UPDATESET
           
static int CLAUSE_UPDATEVALUES
           
static int CLAUSE_UPDATEWHERE
           
static int KEYGEN_INSERT
           
 
Fields inherited from class org.hydrateframework.sql.AbstractParameterStatement
conn, generatedIds, NULL, paramList, rewriteSqlOnQuery, statementType, updateBatchSize, updateStrategy
 
Fields inherited from interface org.hydrateframework.sql.NamedParameterStatement
STMT_DELETE, STMT_INSERT, STMT_NONE, STMT_SELECT, STMT_UPDATE, STRATEGY_BATCH, STRATEGY_NOPREPARE
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
ParsedQuery(java.sql.Connection conn)
           
 
Method Summary
 void addBatch()
           
 void addBatch(java.lang.String str)
           
 void cancel()
           
 void clearBatch()
           
 void clearWarnings()
           
 void close()
           
 boolean execute()
           
 boolean execute(java.lang.String str)
           
 boolean execute(java.lang.String str, int param)
           
 boolean execute(java.lang.String str, int[] values)
           
 boolean execute(java.lang.String str, java.lang.String[] str1)
           
 int[] executeBatch()
           
 java.sql.ResultSet executeForDelete()
           
 java.sql.ResultSet executeForInsert()
           
 java.sql.ResultSet executeForUpdate()
           
 java.sql.ResultSet executeQuery()
           
 java.sql.ResultSet executeQuery(java.lang.String str)
           
 int executeUpdate()
           
 int executeUpdate(java.lang.String str)
           
 int executeUpdate(java.lang.String str, int param)
           
 int executeUpdate(java.lang.String str, int[] values)
           
 int executeUpdate(java.lang.String str, java.lang.String[] str1)
           
 java.sql.Connection getConnection()
           
 int getFetchDirection()
           
 int getFetchSize()
           
 java.sql.ResultSet getGeneratedKeys()
           
 int getMaxFieldSize()
           
 int getMaxRows()
           
 java.sql.ResultSetMetaData getMetaData()
           
 boolean getMoreResults()
           
 boolean getMoreResults(int param)
           
 java.sql.ParameterMetaData getParameterMetaData()
           
 int getQueryTimeout()
           
 java.sql.ResultSet getResultSet()
           
 int getResultSetConcurrency()
           
 int getResultSetHoldability()
           
 int getResultSetType()
           
 int getUpdateCount()
           
 java.sql.SQLWarning getWarnings()
           
 ParsedQuery.SqlInfo[] makeSql(int type, java.util.List<AbstractParameterStatement.Parameter> params)
          Make SQL statement from the query object
 void setArray(int param, java.sql.Array array)
           
 void setAsciiStream(int param, java.io.InputStream inputStream, int param2)
           
 void setBigDecimal(int param, java.math.BigDecimal bigDecimal)
           
 void setBinaryStream(int param, java.io.InputStream inputStream, int param2)
           
 void setBlob(int param, java.sql.Blob blob)
           
 void setBoolean(int param, boolean param1)
           
 void setByte(int param, byte param1)
           
 void setBytes(int param, byte[] values)
           
 void setCharacterStream(int param, java.io.Reader reader, int param2)
           
 void setClob(int param, java.sql.Clob clob)
           
 void setConnection(java.sql.Connection conn)
           
 void setCursorName(java.lang.String str)
           
 void setDate(int param, java.sql.Date date)
           
 void setDate(int param, java.sql.Date date, java.util.Calendar calendar)
           
 void setDelete(java.lang.String[] sql, ParsedQuery.QueryClauseText[] clauses)
           
 void setDouble(int param, double param1)
           
 void setEscapeProcessing(boolean param)
           
 void setFetchDirection(int param)
           
 void setFetchSize(int param)
           
 void setFloat(int param, float param1)
           
 void setGenerateKey(int generateKey)
           
 void setInsert(java.lang.String[] sql, ParsedQuery.QueryClauseText[] clauses)
           
 void setInt(int param, int param1)
           
 void setLong(int param, long param1)
           
 void setMaxFieldSize(int param)
           
 void setMaxRows(int param)
           
 void setNull(int param, int param1)
           
 void setNull(int param, int param1, java.lang.String str)
           
 void setObject(int param, java.lang.Object obj)
           
 void setObject(int param, java.lang.Object obj, int param2)
           
 void setObject(int param, java.lang.Object obj, int param2, int param3)
           
 void setQueryTimeout(int param)
           
 void setRef(int param, java.sql.Ref ref)
           
 void setSelect(java.lang.String[] sql, ParsedQuery.QueryClauseText[] clauses)
           
 void setShort(int param, short param1)
           
 void setString(int param, java.lang.String str)
           
 void setTime(int param, java.sql.Time time)
           
 void setTime(int param, java.sql.Time time, java.util.Calendar calendar)
           
 void setTimestamp(int param, java.sql.Timestamp timestamp)
           
 void setTimestamp(int param, java.sql.Timestamp timestamp, java.util.Calendar calendar)
           
 void setUnicodeStream(int param, java.io.InputStream inputStream, int param2)
           
 void setUpdate(java.lang.String[] sql, ParsedQuery.QueryClauseText[] clauses)
           
 void setUpdateBufferClass(java.lang.Class cls)
           
 void setURL(int param, java.net.URL uRL)
           
 
Methods inherited from class org.hydrateframework.sql.AbstractParameterStatement
clearParameters, getParameterCount, getParameterName, getParameterNames, getParameterType, getUpdateStrategy, setBoolean, setDate, setDouble, setInt, setLong, setNull, setObject, setStatementUsage, setString, setUpdateStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEYGEN_INSERT

public static final int KEYGEN_INSERT
See Also:
Constant Field Values

CLAUSE_SELECT

public static final int CLAUSE_SELECT
See Also:
Constant Field Values

CLAUSE_UPDATE

public static final int CLAUSE_UPDATE
See Also:
Constant Field Values

CLAUSE_INSERT

public static final int CLAUSE_INSERT
See Also:
Constant Field Values

CLAUSE_DELETE

public static final int CLAUSE_DELETE
See Also:
Constant Field Values

CLAUSE_STMTMASK

public static final int CLAUSE_STMTMASK
See Also:
Constant Field Values

CLAUSE_SELECTWHERE

public static final int CLAUSE_SELECTWHERE
See Also:
Constant Field Values

CLAUSE_UPDATEWHERE

public static final int CLAUSE_UPDATEWHERE
See Also:
Constant Field Values

CLAUSE_UPDATESET

public static final int CLAUSE_UPDATESET
See Also:
Constant Field Values

CLAUSE_UPDATEVALUES

public static final int CLAUSE_UPDATEVALUES
See Also:
Constant Field Values

CLAUSE_INSERTWHERE

public static final int CLAUSE_INSERTWHERE
See Also:
Constant Field Values

CLAUSE_INSERTSET

public static final int CLAUSE_INSERTSET
See Also:
Constant Field Values

CLAUSE_INSERTVALUES

public static final int CLAUSE_INSERTVALUES
See Also:
Constant Field Values

CLAUSE_DELETEWHERE

public static final int CLAUSE_DELETEWHERE
See Also:
Constant Field Values

CLAUSE_DELETESET

public static final int CLAUSE_DELETESET
See Also:
Constant Field Values

CLAUSE_SELECTLIST

public static final int CLAUSE_SELECTLIST
See Also:
Constant Field Values

CLAUSE_SELECTPARAM

public static final int CLAUSE_SELECTPARAM
See Also:
Constant Field Values
Constructor Detail

ParsedQuery

public ParsedQuery(java.sql.Connection conn)
Method Detail

setConnection

public void setConnection(java.sql.Connection conn)

setUpdateBufferClass

public void setUpdateBufferClass(java.lang.Class cls)

makeSql

public ParsedQuery.SqlInfo[] makeSql(int type,
                                     java.util.List<AbstractParameterStatement.Parameter> params)
Make SQL statement from the query object

Parameters:
type - the type of statement - one of the STMT_... values
params - pass in an empty list -

setSelect

public void setSelect(java.lang.String[] sql,
                      ParsedQuery.QueryClauseText[] clauses)

setInsert

public void setInsert(java.lang.String[] sql,
                      ParsedQuery.QueryClauseText[] clauses)

setDelete

public void setDelete(java.lang.String[] sql,
                      ParsedQuery.QueryClauseText[] clauses)

setGenerateKey

public void setGenerateKey(int generateKey)

setUpdate

public void setUpdate(java.lang.String[] sql,
                      ParsedQuery.QueryClauseText[] clauses)

executeForInsert

public java.sql.ResultSet executeForInsert()
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

executeForUpdate

public java.sql.ResultSet executeForUpdate()
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

executeForDelete

public java.sql.ResultSet executeForDelete()
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

addBatch

public void addBatch()
              throws java.sql.SQLException
Throws:
java.sql.SQLException

addBatch

public void addBatch(java.lang.String str)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

cancel

public void cancel()
            throws java.sql.SQLException
Throws:
java.sql.SQLException

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

clearBatch

public void clearBatch()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public boolean execute()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String str)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String str,
                       int param)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String str,
                       java.lang.String[] str1)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String str,
                       int[] values)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

executeBatch

public int[] executeBatch()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

executeQuery

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

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String str)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

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

executeUpdate

public int executeUpdate(java.lang.String str)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String str,
                         int param)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String str,
                         java.lang.String[] str1)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String str,
                         int[] values)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getFetchSize

public int getFetchSize()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getGeneratedKeys

public java.sql.ResultSet getGeneratedKeys()
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getMaxFieldSize

public int getMaxFieldSize()
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getMaxRows

public int getMaxRows()
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getMoreResults

public boolean getMoreResults()
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getMoreResults

public boolean getMoreResults(int param)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getParameterMetaData

public java.sql.ParameterMetaData getParameterMetaData()
                                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getQueryTimeout

public int getQueryTimeout()
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getResultSet

public java.sql.ResultSet getResultSet()
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

getResultSetHoldability

public int getResultSetHoldability()
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

getResultSetType

public int getResultSetType()
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

getUpdateCount

public int getUpdateCount()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setArray

public void setArray(int param,
                     java.sql.Array array)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setAsciiStream

public void setAsciiStream(int param,
                           java.io.InputStream inputStream,
                           int param2)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(int param,
                          java.math.BigDecimal bigDecimal)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setBinaryStream

public void setBinaryStream(int param,
                            java.io.InputStream inputStream,
                            int param2)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

setBlob

public void setBlob(int param,
                    java.sql.Blob blob)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setBoolean

public void setBoolean(int param,
                       boolean param1)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setByte

public void setByte(int param,
                    byte param1)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setBytes

public void setBytes(int param,
                     byte[] values)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharacterStream

public void setCharacterStream(int param,
                               java.io.Reader reader,
                               int param2)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

setClob

public void setClob(int param,
                    java.sql.Clob clob)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setCursorName

public void setCursorName(java.lang.String str)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setDate

public void setDate(int param,
                    java.sql.Date date)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setDate

public void setDate(int param,
                    java.sql.Date date,
                    java.util.Calendar calendar)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setDouble

public void setDouble(int param,
                      double param1)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setEscapeProcessing

public void setEscapeProcessing(boolean param)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

setFetchDirection

public void setFetchDirection(int param)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

setFetchSize

public void setFetchSize(int param)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setFloat

public void setFloat(int param,
                     float param1)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setInt

public void setInt(int param,
                   int param1)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setLong

public void setLong(int param,
                    long param1)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setMaxFieldSize

public void setMaxFieldSize(int param)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

setMaxRows

public void setMaxRows(int param)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setNull

public void setNull(int param,
                    int param1)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setNull

public void setNull(int param,
                    int param1,
                    java.lang.String str)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public void setObject(int param,
                      java.lang.Object obj)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public void setObject(int param,
                      java.lang.Object obj,
                      int param2)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public void setObject(int param,
                      java.lang.Object obj,
                      int param2,
                      int param3)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setQueryTimeout

public void setQueryTimeout(int param)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

setRef

public void setRef(int param,
                   java.sql.Ref ref)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setShort

public void setShort(int param,
                     short param1)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

public void setString(int param,
                      java.lang.String str)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setTime

public void setTime(int param,
                    java.sql.Time time)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setTime

public void setTime(int param,
                    java.sql.Time time,
                    java.util.Calendar calendar)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int param,
                         java.sql.Timestamp timestamp)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int param,
                         java.sql.Timestamp timestamp,
                         java.util.Calendar calendar)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setURL

public void setURL(int param,
                   java.net.URL uRL)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setUnicodeStream

public void setUnicodeStream(int param,
                             java.io.InputStream inputStream,
                             int param2)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2000 The Hydrate Project. All Rights Reserved.