SQLJ connections options specify the database connection for online checking. The general form for connection options is
-option@context=value
where option
is one of the four options listed
below.
The context
tag is a connection context type,
which permits the use of separate exemplar schemas for each of the
connection contexts. If you omit the connection context type, the
value
will be used for any SQL statements that use the default
connection context. The driver
option does not allow a
context
tag.
The options are:
user
This option specifies the user name for connecting
to a database in order to perform semantic analysis of the SQL
expressions embedded in a SQLJ program. It contains the user name, for
example:-user=scott
The user
command line option may include a connection context type. For example:
-user@Ctx1=Scott
Ctx1
, SQLJ uses the
user
option that was tagged with Ctx1
. If it can not find
one, SQLJ issues a message and looks for an untagged user
option to use instead.user
value indicates to SQLJ that online checking is to be performed. If
you do not specify the user
option, SQLJ does
not connect to the database for semantic analysis. There is no default
value for the user
option.
-user=Scott
), then in order to disable online checking for a
particular connection context type Ctx2
, you must
explicitly specify an empty user name, for example:
-user@Ctx2Z
password
This option specifies a password for the user.
The password will be requested interactively if it is not supplied.
This option can be tagged with a connection context type. Examples of
the two forms are:-password=tiger
-password@Ctx1=tiger
url
This option specifies a JDBC URL for establishing a
database connection. The default is jdbc:oracle:oci9:@
.
This option can be tagged with a connection context type. For example:
-url=jdbc:oracle:oci8:@ -url@Ctx1=jdbc:oracle:thin:@<local_host>:1521:orcl
driver
This option specifies a list of JDBC drivers that
should be registered in order to interpret JDBC connection URLs for
online analysis. The default is oracle.jdbc.driver.OracleDriver
. Example:
-driver=sun.jdbc.odbc.JdbcOdbcDriver,oracle.jdbc.driver.OracleDriver
This option cannot be tagged with a connection context type.
Embedding SQL in Java Programs
with SQLJ
Using Named
SQLJ Connection Contexts
Copyright © 1997, 2004, Oracle. All rights reserved.