![]() |
Using ij
|
|
Getting Started with ijConnecting to a Cloudscape DatabaseTo connect to a Cloudscape database, you need to perform two steps: In ij, there are three basic ways of accomplishing these steps:
D:>java COM.cloudscape.tools.ij ij version 3.6 (c) 1997-2000 Informix Software, Inc. ij> connect 'jdbc:cloudscape:toursDB'; ij> ij> connect 'jdbc:cloudscape:rmi://localhost:1099/toursDB';
D:>java COM.cloudscape.tools.ij ij version 3.6 (c) 1997-2000 Informix Software, Inc. ij> protocol 'jdbc:cloudscape:'; ij> connect 'toursDB';
D:>java COM.cloudscape.tools.ij ij version 3.6 (c) 1997-2000 Informix Software, Inc. ij> driver 'sun.jdbc.odbc.JdbcOdbcDriver'; ij> connect 'myOdbcDataSource'; ij> Table 3-1, "Specifying the Driver Name and database connection URL", summarizes the different ways to specify the driver name and database connection URL.
ij and ServersYou can use ij as a client application that interacts with Cloudscape running in a server framework. To do that, simply load the appropriate driver and use the appropriate protocol for the server framework, either RmiJdbc or Cloudconnector. To see what driver you need for the server framework, see Drivers. To see what protocol you need for the server framework, see Database Connection URLs. For examples of doing this with either framework, see the previous section, Connecting to a Cloudscape Database. This section contains numerous examples of doing that. Using ij Commandsij accepts a number of different commands that let you execute SQL statements or run scripts. Each ij statement must end with a semicolon. For complete information about ij commands, see ij Commands and Errors Reference. Other Uses for ijij is a JDBC-neutral scripting tool with a small command set. It can be used to access any JDBC driver and database accessible through that driver. The main benefit of a tool such as ij is that it is easy to run scripts for creating a database schema and automating other repetitive database tasks. In addition, ij accepts and processes SQL commands interactively for ad hoc database access. Running ij ScriptsYou can run scripts in ij in a few different ways:
ij echoes input from a file if
If you redirect standard input to come from a file, ij does not echo commands. You can save output by redirecting output to a file or by setting the ij.outfile property. (See ij.outfile.) For example: java -Djdbc.drivers=COM.cloudscape.core.JDBCDriver ij automatically shuts down an embedded Cloudscape system (issues a connect `jdbc:cloudscape:;shutdown=true' request) when the Exit command is issued. It does not shut down Cloudscape running in a server framework. ij exits when the Exit command is entered or if given a command file on the Java invocation line, when the end of the command file is reached. |
||||||||||||||||
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |