ij Commands and Errors Reference,
Page 2 of 37


[top]
[prev]
[next]
Documentation Top
Index for This Book

Absolute
After Last
Async
Autocommit
Before First
Close
Commit
Connect
Disconnect
Driver
Elapsedtime
Execute
Exit
First
Get Cursor
Get Scroll Insensitive Cursor
Help
Last
MaximumDisplayWidth
Next
Prepare
Previous
Protocol
Readonly
Relative
Remove
Rollback
Run
Set Connection
Show Connections
Wait For

ij Commands

ij accepts several commands to control its use of JDBC. It recognizes a semicolon as the end of an ij or SQL command; it treats semicolons within SQL comments, strings, and delimited identifiers as part of those constructs, not as the end of the command. Semicolons are required at the end of an ij or SQL statement.

All ij commands, identifiers, and keywords are case-insensitive.

Commands can span multiple lines without any special escaping for the ends of lines. This means that if a string spans a line, the newlines will show up in the value in the string.

ij treats any command that it does not recognize as an SQL command to be passed to the underlying connection, so syntactic errors in ij commands will cause them to be handed to the SQL engine and will probably result in SQL parsing errors.

The ij commands are:

Absolute

After Last

Autocommit

Before First

Close

Commit

Connect

Disconnect

Driver

Elapsedtime

Execute

Exit

First

Get Cursor

Get Scroll Insensitive Cursor

Help

Last

MaximumDisplayWidth

Next

Prepare

Previous

Protocol

Readonly

Relative

Remove

Rollback

Run

Set Connection

Show Connections

Wait For

The ij common elements (used in several commands) are:

Conventions for ij Examples

Examples in this document show input from the keyboard or a file in bold text and console output from the DOS prompt or the ij application in regular text.

 C:\> REM This example is from a DOS prompt using JDK1.1.x java:
 C:\> java -Dij.protocol=jdbc:cloudscape: COM.cloudscape.tools.ij
 ij version 3.0 (c) 1997-1999 Cloudscape, Inc.
 ij> connect 'menuDB;create=true';
 ij> create table menu(course char(10), item char(20), price integer);
 0 rows inserted/updated/deleted
 ij> disconnect;
 ij> exit;
 C:\> 

ij SQL Command Behavior

Any command other than those documented in “ij Command Reference” are handed to the current connection to execute directly. The statement’s closing semicolon, used by ij to determine that it has ended, is not passed to the underlying connection. Only one statement at a time is passed to the connection. If the underlying connection itself accepts semicolon-separated statements (which Cloudscape does not), they can be passed to the connection using ij’s Execute command to pass in a command string containing semicolon-separated commands.

ij uses the result of the JDBC execute request to determine whether it should print a number-of-rows message or display a result set.

If a JDBC execute request causes an exception, it displays the SQLState, if any, and error message.

Setting the ij property ij.showErrorCode to true displays the SQLException’s error code (see Chapter 4, “ij Properties Reference”).

The number-of-rows message for inserts, updates, and deletes conforms to the JDBC specification for any SQL statement that does not have a result set. DDL (data definition language) commands typically report “0 rows inserted/updated/deleted” when they successfully complete.

To display a result set, ij formats a banner based on the JDBC ResultSetMetaData information returned from getColumnLabel and getColumnWidth. Long columns wrap the screen width, using multiple lines. An & character denotes truncation (ij limits displayed width of a column to 128 characters by default; see “MaximumDisplayWidth”).

ij displays rows as it fetches them. If the underlying DBMS materializes rows only as they are requested, ij displays a partial result followed by an error message if there is a error in fetching a row partway through the result set.

ij verifies that a connection exists before issuing statements against it and does not execute SQL when no connection has yet been made.

There is no support in ij for the JDBC feature multiple result sets.

Example

 ij> INSERT INTO menu VALUES ('appetizer','baby greens',7);
 1 row inserted/updated/deleted
 ij> SELECT * FROM menu;
 COURSE    |ITEM                |PRICE          
 -----------------------------------------------
 entree    |lamb chop           |14            
 dessert   |creme brulee        |6
 appetizer |baby greens         |7
 
 3 rows selected
 ij> 
[top]
[prev]
[next]


Cloudscape Version 3.0
For technical support, go to: www.cloudscape.com and click Support.
Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved.