Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.common.sql.DropRequest Class Reference

Inheritance diagram for org.objectweb.cjdbc.common.sql.DropRequest:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.common.sql.DropRequest:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DropRequest (String sqlQuery, boolean escapeProcessing, int timeout, String lineSeparator, DatabaseSchema schema, int granularity, boolean isCaseSensitive) throws SQLException
 DropRequest (String sqlQuery, boolean escapeProcessing, int timeout, String lineSeparator)
void parse (DatabaseSchema schema, int granularity, boolean isCaseSensitive) throws SQLException
void cloneParsing (AbstractRequest request)
boolean isInsert ()
boolean isUpdate ()
boolean isDelete ()
boolean isCreate ()
boolean isDrop ()
void debug ()
boolean isAlter ()

Detailed Description

An DropRequest is an SQL request with the following syntax:

  DROP TABLE table-name
 

Author:
Julie Marguerite

Mathieu Peltier

Version:
1.0

Definition at line 44 of file DropRequest.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.common.sql.DropRequest.DropRequest String  sqlQuery,
boolean  escapeProcessing,
int  timeout,
String  lineSeparator,
DatabaseSchema  schema,
int  granularity,
boolean  isCaseSensitive
throws SQLException
 

Creates a new DropRequest instance. The caller must give an SQL request, without any leading or trailing spaces and beginning with 'drop table ' (it will not be checked).

If the syntax is incorrect an exception is thrown.

Parameters:
sqlQuery a String value
escapeProcessing should the driver to escape processing before sending to the database ?
timeout an int value
lineSeparator the line separator used in the query
schema a DatabaseSchema value
granularity parsing granularity as defined in ParsingGranularities
isCaseSensitive true if parsing is case sensitive
Exceptions:
SQLException if an error occurs

Definition at line 65 of file DropRequest.java.

References org.objectweb.cjdbc.common.sql.DropRequest.parse().

00068   {
00069     this(sqlQuery, escapeProcessing, timeout, lineSeparator);
00070     parse(schema, granularity, isCaseSensitive);
00071   }

org.objectweb.cjdbc.common.sql.DropRequest.DropRequest String  sqlQuery,
boolean  escapeProcessing,
int  timeout,
String  lineSeparator
 

Creates a new DropRequest instance. The caller must give an SQL request, without any leading or trailing spaces and beginning with 'create table ' (it will not be checked).

The request is not parsed but it can be done later by a call to parse(DatabaseSchema, int, boolean).

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

Definition at line 88 of file DropRequest.java.

00090   {
00091     super(sqlQuery, escapeProcessing, timeout, lineSeparator);
00092     cacheable = RequestType.UNCACHEABLE;
00093     isParsed = false;
00094   }


Member Function Documentation

void org.objectweb.cjdbc.common.sql.DropRequest.cloneParsing AbstractRequest  request  )  [virtual]
 

See also:
AbstractRequest.cloneParsing(AbstractRequest)

Implements org.objectweb.cjdbc.common.sql.AbstractRequest.

Definition at line 137 of file DropRequest.java.

References org.objectweb.cjdbc.common.sql.AbstractWriteRequest.cloneTableNameAndColumns(), and org.objectweb.cjdbc.common.sql.AbstractRequest.isParsed.

00138   {
00139     if (!request.isParsed())
00140       return;
00141     cloneTableNameAndColumns((AbstractWriteRequest) request);
00142     isParsed = true;
00143   }

void org.objectweb.cjdbc.common.sql.DropRequest.debug  ) 
 

Displays some debugging information about this request.

Reimplemented from org.objectweb.cjdbc.common.sql.AbstractRequest.

Definition at line 193 of file DropRequest.java.

00194   {
00195     super.debug();
00196     if (tableName != null)
00197       System.out.println("Dropped table '" + tableName + "'");
00198     else
00199       System.out.println("No information about dropped table");
00200 
00201     System.out.println();
00202   }

boolean org.objectweb.cjdbc.common.sql.DropRequest.isAlter  )  [virtual]
 

See also:
org.objectweb.cjdbc.common.sql.AbstractWriteRequest.isAlter()

Implements org.objectweb.cjdbc.common.sql.AbstractWriteRequest.

Definition at line 206 of file DropRequest.java.

00207   {
00208     return false;
00209   }

boolean org.objectweb.cjdbc.common.sql.DropRequest.isCreate  )  [virtual]
 

Returns:
false
See also:
org.objectweb.cjdbc.common.sql.AbstractWriteRequest.isCreate()

Implements org.objectweb.cjdbc.common.sql.AbstractWriteRequest.

Definition at line 176 of file DropRequest.java.

00177   {
00178     return false;
00179   }

boolean org.objectweb.cjdbc.common.sql.DropRequest.isDelete  )  [virtual]
 

Returns:
false
See also:
org.objectweb.cjdbc.common.sql.AbstractWriteRequest.isDelete()

Implements org.objectweb.cjdbc.common.sql.AbstractWriteRequest.

Definition at line 167 of file DropRequest.java.

00168   {
00169     return false;
00170   }

boolean org.objectweb.cjdbc.common.sql.DropRequest.isDrop  )  [virtual]
 

Returns:
true
See also:
org.objectweb.cjdbc.common.sql.AbstractWriteRequest.isDrop()

Implements org.objectweb.cjdbc.common.sql.AbstractWriteRequest.

Definition at line 185 of file DropRequest.java.

00186   {
00187     return true;
00188   }

boolean org.objectweb.cjdbc.common.sql.DropRequest.isInsert  )  [virtual]
 

Returns:
false
See also:
org.objectweb.cjdbc.common.sql.AbstractWriteRequest.isInsert()

Implements org.objectweb.cjdbc.common.sql.AbstractWriteRequest.

Definition at line 149 of file DropRequest.java.

00150   {
00151     return false;
00152   }

boolean org.objectweb.cjdbc.common.sql.DropRequest.isUpdate  )  [virtual]
 

Returns:
false
See also:
org.objectweb.cjdbc.common.sql.AbstractWriteRequest.isUpdate()

Implements org.objectweb.cjdbc.common.sql.AbstractWriteRequest.

Definition at line 158 of file DropRequest.java.

00159   {
00160     return false;
00161   }

void org.objectweb.cjdbc.common.sql.DropRequest.parse DatabaseSchema  schema,
int  granularity,
boolean  isCaseSensitive
throws SQLException [virtual]
 

See also:
org.objectweb.cjdbc.common.sql.AbstractRequest.parse(org.objectweb.cjdbc.common.sql.schema.DatabaseSchema, int, boolean)

Implements org.objectweb.cjdbc.common.sql.AbstractRequest.

Definition at line 100 of file DropRequest.java.

References org.objectweb.cjdbc.common.sql.schema.DatabaseTable.getName().

Referenced by org.objectweb.cjdbc.common.sql.DropRequest.DropRequest().

00102   {
00103     if (granularity == ParsingGranularities.NO_PARSING)
00104     {
00105       isParsed = true;
00106       return;
00107     }
00108 
00109     String originalSQL = this.trimCarriageReturn();
00110     String dropTable = originalSQL.toLowerCase();
00111 
00112     // Strip 'drop (temporary) table '
00113     int tableIdx = dropTable.indexOf("table");
00114     if (isCaseSensitive)
00115       dropTable = originalSQL.substring(tableIdx + 5).trim();
00116     else
00117       dropTable = dropTable.substring(tableIdx + 5).trim();
00118 
00119     if (schema == null)
00120       tableName = dropTable;
00121     else
00122     {
00123       // Get the table on which DROP occurs
00124       DatabaseTable t = schema.getTable(dropTable, isCaseSensitive);
00125       if (t == null)
00126         throw new SQLException("Unknown table '" + dropTable
00127             + "' in this DROP statement '" + sqlQuery + "'");
00128       else
00129         tableName = t.getName();
00130     }
00131     isParsed = true;
00132   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:02:07 2005 for C-JDBC by  doxygen 1.3.9.1