org.objectweb.cjdbc.common.sql
Class UnknownRequest

java.lang.Object
  extended byorg.objectweb.cjdbc.common.sql.AbstractRequest
      extended byorg.objectweb.cjdbc.common.sql.UnknownRequest
All Implemented Interfaces:
java.io.Serializable

public class UnknownRequest
extends AbstractRequest
implements java.io.Serializable

An UnknownRequest is an SQL request that does not match any SQL query known by this software.

Version:
1.0
Author:
Emmanuel Cecchet , Mathieu Peltier
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class org.objectweb.cjdbc.common.sql.AbstractRequest
cacheable, cursorName, escapeProcessing, fetchSize, id, isAutoCommit, isParsed, isReadOnly, login, maxRows, requestType, sqlQuery, sqlSkeleton, timeoutInSeconds, transactionId, transactionIsolation
 
Constructor Summary
UnknownRequest(CJDBCInputStream in)
           
UnknownRequest(java.lang.String sqlQuery, boolean escapeProcessing, int timeout, java.lang.String lineSeparator)
          Creates a new UnknownRequest instance.
 
Method Summary
 void cloneParsing(AbstractRequest request)
          Throws always an SQLException: it is not possible to parse an unknown request because we don't know its syntax or semantic.
 boolean needsMacroProcessing()
          Returns true if this request requires macro (RAND(), NOW(), ...) processing.
 void parse(DatabaseSchema schema, int granularity, boolean isCaseSensitive)
          Throws always an SQLException: it is not possible to parse an unknown request because we don't know its syntax or semantic.
 boolean returnsResultSet()
          Does this request returns a ResultSet?
 void sendToStream(CJDBCOutputStream out, boolean needSqlSkeleton)
          Serialize the request on the output stream by sending only the needed parameters to reconstruct it on the controller.
 
Methods inherited from class org.objectweb.cjdbc.common.sql.AbstractRequest
debug, equals, getCacheAbility, getCursorName, getEscapeProcessing, getFetchSize, getId, getLineSeparator, getLogin, getMaxRows, getSQL, getSQLShortForm, getSqlSkeleton, getTimeout, getTransactionId, getTransactionIsolation, isAlter, isAutoCommit, isCreate, isDDL, isDelete, isDML, isDriverProcessed, isDrop, isInsert, isParsed, isReadOnly, isSelect, isUpdate, receiveResultSetParams, sendResultSetParams, setCacheAbility, setCursorName, setDriverProcessed, setFetchSize, setId, setIsAutoCommit, setIsReadOnly, setLogin, setMaxRows, setSQL, setSqlSkeleton, setTimeout, setTransactionId, setTransactionIsolation, trimCarriageReturnAndTabs
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

UnknownRequest

public UnknownRequest(java.lang.String sqlQuery,
                      boolean escapeProcessing,
                      int timeout,
                      java.lang.String lineSeparator)
Creates a new UnknownRequest instance.

Parameters:
sqlQuery - the SQL query
escapeProcessing - should the driver to escape processing before sending to the database?
timeout - an int value
lineSeparator - the line separator used in the query

UnknownRequest

public UnknownRequest(CJDBCInputStream in)
               throws java.io.IOException
See Also:
AbstractRequest
Method Detail

sendToStream

public void sendToStream(CJDBCOutputStream out,
                         boolean needSqlSkeleton)
                  throws java.io.IOException
Description copied from class: AbstractRequest
Serialize the request on the output stream by sending only the needed parameters to reconstruct it on the controller. Has to mirror the deserialization method above.

Overrides:
sendToStream in class AbstractRequest
Parameters:
out - destination CJDBCOutputStream
needSqlSkeleton - true if controller wants SQL templates
Throws:
java.io.IOException - if fails
See Also:
AbstractRequest

needsMacroProcessing

public boolean needsMacroProcessing()
Description copied from class: AbstractRequest
Returns true if this request requires macro (RAND(), NOW(), ...) processing.

Specified by:
needsMacroProcessing in class AbstractRequest
Returns:
false
See Also:
AbstractRequest.needsMacroProcessing()

returnsResultSet

public boolean returnsResultSet()
Description copied from class: AbstractRequest
Does this request returns a ResultSet?

Specified by:
returnsResultSet in class AbstractRequest
Returns:
true is this request will return a ResultSet
See Also:
AbstractRequest.returnsResultSet()

parse

public void parse(DatabaseSchema schema,
                  int granularity,
                  boolean isCaseSensitive)
           throws java.sql.SQLException
Throws always an SQLException: it is not possible to parse an unknown request because we don't know its syntax or semantic.

Specified by:
parse in class AbstractRequest
Parameters:
schema - a DatabaseSchema value
granularity - parsing granularity as defined in ParsingGranularities
isCaseSensitive - true if parsing must be case sensitive
Throws:
java.sql.SQLException - if the parsing fails
See Also:
AbstractRequest.parse(org.objectweb.cjdbc.common.sql.schema.DatabaseSchema, int, boolean)

cloneParsing

public void cloneParsing(AbstractRequest request)
Throws always an SQLException: it is not possible to parse an unknown request because we don't know its syntax or semantic.

Specified by:
cloneParsing in class AbstractRequest
Parameters:
request - the parsed request to clone
See Also:
AbstractRequest.cloneParsing(AbstractRequest)


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.