BNF for ij.jj
NON-TERMINALS
//
// start of BNF rules
//
/**
* ProtocolStatement is PROTOCOL 'JDBC protocol' where
* the protocol is used to prefix any connect request that
* cannot find a driver. We will take a stab at loading
* a driver as each protocol comes in -- we only know about
* two.
*/
/**
* DriverStatement is DRIVER 'class' where class is the
* name of a class that is a JDBC driver. It is loaded
* into the DriverManager with a Class.forName call.
*
* You can load as many drivers as you want, the idea is
* to load up the appropriate one(s) for the connect(s)
* that you will be issuing.
*/
/**
* ConnectStatement is CONNECT 'url' [ PROTOCOL proto ]
[ USER String PASSWORD String ]
[ATTRIBUTES attributeName = value [, attributeName = value]* ]
[ AS ident ], where url is the
* url for the database, i.e. jdbc:protocol:dbname etc.
* Attributes are connection attributes to
*
* There can only be one connection at a time; if there
* is already one, it is put on hold and this one takes its place.
*
* if a driver can't be found, the current protocol will
* be added at the front.
*
* the as ident part is used for set connection. If you don't
* specify a name, we create one that is CONNECTION# for the #
* of open connections that now exists. If the name duplicates,
* an error results.
*/
/**
* Handles DESCRIBE table
*/
/**
* Handles CONNECT yadda.yadda.foo( stringArg, ... stringArg ) AS connectionName
*/
/**
* SetConnectionStatement is SET CONNECTION ident
*
* Moves to the named session, if it exists. If it doesn't
* exist, remains on the current session and returns an error.
*/
/**
* Handles showing current connections for the current environment, and
* SHOW TABLES/VIEWS/... commands.
*/
/**
* CommitStatement is simply COMMIT.
* It commits the current transation.
*/
/**
* RollbackStatement is simply ROLLBACK.
* It undoes the current transation.
*/
/**
* DisconnectStatement is simply DISCONNECT [ ALL | CURRENT | connectionName ]
* it ends the specified connection(s) and
* releases its statement resource.
*
* If ALL is specified, it disconnects all available sessions
* in the current environment.
*/
scrollType
scrollType |
::= |
<INSENSITIVE> |
|
| |
<SENSITIVE> |
/**
* Two forms of execute: immediate, with a string
* and prepared, with the id of a prepared statement.
* We expect the latter form will
* eventually support a USING clause to supply
* parameter values (that will be constants).
* No parameters yet, however.
*
* Syntax:
* EXECUTE statementSource [ USING statementSource] ;
*
* statementSource is an identifier of a previously prepared statement
* or a string containing SQL-J text.
*/
/**
* Async: like execute immediate, without using,
* but runs the statement in a separate thread, against
* the current connection.
*
* Syntax:
* ASYNC asyncName statementSource
*
* statementSource is a string containing SQL-J text.
*/
/**
* Wait for: the second half of Async, waits for completion
* if needed and then supplies the result. Only execute is done,
* not row fetching.
*
* Syntax:
* WAIT FOR asyncName
*
* asyncName is a name used in an ASYNC statement previously
*/
/**
* RemoveStatement is REMOVE identifier. It identifies
* a previously prepared statement. We would prefer a DROP
* syntax, but SQL-J is using that word and I want to point out
* that special processing will be needed to give that parser
* this parser's input for unrecognized text.
*/
RunStatement
RunStatement |
::= |
<RUN> ( <RESOURCE> )? <STRING> |
/**
* Autocommit lets you control this aspect of the connection.
* REMIND: should have a general way to set all connection attributes,
* this is a shortcut for immediate needs.
*
* Syntax:
* AUTOCOMMIT [ ON | OFF ] ;
*/
/**
* By default, holdability is set to true for Connection objects. This syntax NOHOLDFORCONNECTION lets you set it to close cursors at commit.
* Syntax:
* NOHOLDFORCONNECTION ;
*/
/**
* By default, holdability is set to true for Connection objects. This syntax HOLDFORCONNECTION lets you set it to the default.
* Syntax:
* HOLDFORCONNECTION ;
*/
/**
* Localizeddisplay controls locale sensitive data representayion
*
* Syntax:
* LOCALIZEDDISPLAY [ ON | OFF ] ;
*/
/**
* ReadOnly lets you control this aspect of the connection.
* REMIND: should have a general way to set all connection attributes,
* this is a shortcut for immediate needs.
*
* Syntax:
* READONLY [ ON | OFF ] ;
*/
/**
* Elapsedtime on causes ij to dump out the elapsed time it takes
* to run a user statement at the end of that statement.
*
* Syntax:
* ELAPSEDTIME [ ON | OFF ] ;
*/
/**
* MaximumDisplayWidth EXACT_NUMERIC changes the maximum display width for
* java.lang.String to the specified EXACT_NUMERIC.
* This is only used by the console view.
*
* Syntax:
* MAXIMUMDISPLAYWIDTH INTEGER ;
*/
/**
* Bang lets you issue a system command using System.exec.
*
* Syntax:
* ! 'command to issue' ;
*/
Bang
Bang |
::= |
<BANG> <STRING> |
/**
Haven't included: ASYNC, !, EXPECT
Don't include: XA_*
**/
/**
A qualified identifier is localName [ sessionName ]
*/
/**
A case/connection respectful identifier.
Like an ordinary identifier(), but require a connection in order
to extract the case policy from database meta data.
*/
/*
* sign
*/
sign
sign |
::= |
<PLUS_SIGN> |
|
| |
<MINUS_SIGN> |
/**
Undocumented commands to help XA testing.
This is the grammer for the XA commands
<XA_DATASOURCE> 'dbname' ( <CREATE> | shutdown )
- get a XADataSource whose database name is dbname and make that
XADataSource the current XADataSource
<XA_CONNECT> [ <USER> 'user' ]
[ <PASSWORD> 'password' ]
[ <AS> xaconnid ]
- make an XAConnection using the current XADataSource and make
that XAConnection the current XAConnection. If xaconnid is
given, then associate xaconnid with the XAConnection.
(xaconnid not implemeneted)
<XA_COMMIT> ( <XA_1PHASE> | <XA_2PHASE> ) xid
- commit a global transaction xid
<XA_DISCONNECT> [ xaconnid = identifier() ]
- disconnect an XAConnection. If xaconnid is given, then
disconnect the XAConnection with the given xaconnid.
(xaconnid not implemeneted)
<XA_END> ( <XA_SUSPEND> | <XA_SUCCESS> | <XA_FAIL> ) xid
- dissociate a transaction from the current XAConnection or end
an already suspened one
<XA_FORGET> xid - forget about a global transaction
<XA_GETCONNECTION> [ <AS> connid ]
- get a Connection object from the current XAConnection.
If connid is given, then associate connid with the connection.
(connid not implemented)
<XA_PREPARE> xid - prepare a global transaction
<XA_RECOVER> ( <XA_NOFLAGS> | <XA_STARTRSCAN> | <XA_ENDRSCAN> )
- return the list of in-doubt transactions
<XA_ROLLBACK> xid - rollback a global transaction
<XA_START> ( <XA_NOFLAGS> | <XA_JOIN> | <XA_RESUME> ) xid
- associate a transaction or start a new global
transaction with the current XAConnection.
The following is for testing other JDBC2.0 ext interface, DataSource
and ConnectionPoolDataSource. Strictly speaking, these are not xa, but
their functionality will be lumped into xaHelper because these are here
only for testing purposes.
<DATASOURCE> 'dbname' [ <PROTOCOL> 'protocol' ]
[ <USER> 'user' ]
[ <PASSWORD> 'password' ]
[ <AS> n=identifier() ]
- get a data source whose database name is dbname and make that
DataSource the current DataSource. If <PROTOCOL> is specified,
the DataSource may be remote. Get a connection from that
dataSource and use the user/password if specified.
<CP_DATASOURCE> 'dbname' [ <PROTOCOL> 'protocol' ]
- get a connection pool data source whose database name is
dbname and make that DataSource the current CPDataSource.
If <PROTOCOL> is specified, the DataSource may be
remote.
<CP_CONNECT> [ <USER> 'user' ]
[ <PASSWORD> 'password' ]
[ <AS> cpconnid ]
- make a PooledConnection using the current CPDataSource and
make that PooledConnection the current PooledConnection.
If cpconnid is given, then associate cpconnid with the
PooledConnection. (cpconnid not implemented).
<CP_GETCONNECTION> [ <AS> connid ]
- get a Connection object from the current PooledConnection.
If connid is given, the associate connid with the connection.
(connid not implemented)
<CP_DISCONNECT> [ cpconnid = identifier() ]
- disconnect a PooledConnection. If cpconnid is given, then
disconnect the PooledConnection with the given cpconnid.
(cpconnid not implemented)
*/
/**
* XA_DataSourceStatement is XA_DataSource 'dbname' ( create | shutdown )
* We new'ed an instance of XADataSource as the current DataSource and set its
* database name to dbname.
*/
/**
* XA_ConnectStatement is XA_CONNECT (<AS> connid)
* make a XAConnection using the currentXADataSource and make that XAConnection
* the current XAConnection. If connid is given, then associate connid with
* the XAConnection. This connid is not th xid.
*/
/**
* XA_DisconnectStatement is XA_DISCONNECT [xaconnid = identifier()]
* disconnect the current XAConnection
* If xaconnid is given, then disconnect XAConnection with xaconnid (xaconnid
* not implemented).
*
*/
/**
* XA_CommitStatement is XA_COMMIT [ XA_1PHASE | XA_2PHASE ] xid
* commits a global transaction xid
*/
/**
* XA_EndStatement is XA_END [ XA_SUSPEND | XA_SUCCESS | XA_FAIL] xid
* dissociates a transaction from the current XAConnection or end an already
* suspended one
*/
/**
* XA_ForgetStatement is XA_FORGET xid
* forgets about a heuristically completed transaction
*/
/**
* XA_GetConnectionStatement is XA_GETCONNECTION
* it gets a Connection from the currentXAConnection and uses that as the
* current connection
*/
/**
* XA_PrepareStatement is XA_PREPARE xid
* prepares a global transaction
*/
/**
* XA_RecoverStatement is XA_RECOVER flag
* displays the list of prepared transactions
*/
/**
* XA_RollbackStatement is XA_Rollback xid
* rolls back a global transaction
*/
/**
* XA_StartStatement is XA_START [ XA_NOFLAGS | XA_JOIN | XA_RESUME ] xid
* start or associates a transaction with the current XAConnection
*/
xatmflag
xatmflag |
::= |
<XA_ENDRSCAN> |
|
| |
<XA_FAIL> |
|
| |
<XA_JOIN> |
|
| |
<XA_NOFLAGS> |
|
| |
<XA_RESUME> |
|
| |
<XA_STARTRSCAN> |
|
| |
<XA_SUCCESS> |
|
| |
<XA_SUSPEND> |
/**
* DataSourceStatement is
* DataSource 'dbname'
* [ <PROTCOL> 'protocol']
* [ <USER> 'user' ]
* [ <PASSWORD> 'password' ]
* [ <AS> n=identifier() ]
*
* We new'ed an instance of DataSource as the current DataSource and set its
* database name to dbname. Also get a connection
*/
DataSourceStatement
DataSourceStatement |
::= |
<DATASOURCE> <STRING> ( <PROTOCOL> <STRING> )? ( <USER> <STRING> )? ( <PASSWORD> <STRING> )? ( <AS> identifier )? |
/**
* CP_DataSourceStatement is
* CP_DataSource 'dbname' [ <PROTOCOL> 'protocol' ]
* - get a connection pool data source whose database name is
* dbname and make that DataSource the current CPDataSource.
* If <PROTOCOL> is specified, the DataSource may be
* remote.
*/
/**
* CP_ConnectStatement is
* <CP_CONNECT> [ <USER> 'user' ]
* [ <PASSWORD> 'password' ]
* [ <AS> cpconnid ]
* make a PooledConnection using the current CPDataSource and
* make that PooledConnection the current PooledConnection.
* If cpconnid is given, then associate cpconnid with the
* PooledConnection. (cpconnid not implemented).
*/
/**
* CP_GetConnectionStatement is
* <CP_GETCONNECTION> [ <AS> connid ]
* get a Connection object from the current PooledConnection.
* If connid is given, the associate connid with the connection.
* (connid not implemented)
*/
/**
* CP_DisconnectStatement is
* <CP_DISCONNECT> [ cpconnid = identifier() ]
* disconnect a PooledConnection. If cpconnid is given, then
* disconnect the PooledConnection with the given cpconnid.
* (cpconnid not implemented)
*/
keyword
keyword |
::= |
( <ABSOLUTE> | <AFTER> | <ALIASES> | <ALL> | <AS> | <ASYNC> | <ATTRIBUTES> | <AUTOCOMMIT> | <BANG> | <BEFORE> | <CLOSE> | <COMMIT> | <CONNECT> | <CONNECTION> | <CONNECTIONS> | <CURRENT> | <CURSOR> | <DESCRIBE> | <DISCONNECT> | <DRIVER> | <ELAPSEDTIME> | <END> | <EXECUTE> | <EXIT> | <FAIL> | <FIRST> | <FOR> | <FROM> | <GET> | <GETCURRENTROWNUMBER> | <HOLD> | <HELP> | <IN> | <INDEXES> | <INSENSITIVE> | <INTO> | <LAST> | <LOCALIZEDDISPLAY> | <MAXIMUMDISPLAYWIDTH> | <NAME> | <NEXT> | <NOHOLD> | <NOHOLDFORCONNECTION> | <OFF> | <ON> | <PASSWORD> | <PERIOD> | <PREPARE> | <PREVIOUS> | <PROCEDURE> | <PROCEDURES> | <PROPERTIES> | <PROTOCOL> | <QUIT> | <READONLY> | <RELATIVE> | <REMOVE> | <RESOURCE> | <ROLLBACK> | <RUN> | <TO> | <SCHEMAS> | <SCROLL> | <SENSITIVE> | <SET> | <SHOW> | <SHUTDOWN> | <STATEMENT> | <SYNONYMS> | <TABLES> | <USER> | <USING> | <VIEWS> | <WAIT> | <WITH> | <XA_1PHASE> | <XA_2PHASE> | <XA_DATASOURCE> | <XA_CONNECT> | <XA_COMMIT> | <XA_DISCONNECT> | <XA_END> | <XA_ENDRSCAN> | <XA_FAIL> | <XA_FORGET> | <XA_GETCONNECTION> | <XA_JOIN> | <XA_NOFLAGS> | <XA_PREPARE> | <XA_RECOVER> | <XA_RESUME> | <XA_ROLLBACK> | <XA_START> | <XA_STARTRSCAN> | <XA_SUCCESS> | <XA_SUSPEND> | <DATASOURCE> | <CP_DATASOURCE> | <CP_CONNECT> | <CP_GETCONNECTION> | <CP_DISCONNECT> | <WORK> ) |