Oracle8i SQLJ Developer's Guide and Reference Release 3 (8.1.7) Part Number A83723-01 |
|
This section consists of two properties files--one for the SQLJ runtime connection and one for translator option settings. These files are located in the following directory:
[Oracle Home]/sqlj/demo
The sample applications in this chapter use the Oracle.connect()
method, a convenient way to create an instance of the DefaultContext
class and establish it as your default connection. This method offers several signatures; the signature used in the samples takes a properties file--connect.properties
--to specify connection parameters. Here are sample contents of that file:
# Users should uncomment one of the following URLs or add their own. # (If using Thin, edit as appropriate.) #sqlj.url=jdbc:oracle:thin:@localhost:1521:ORCL sqlj.url=jdbc:oracle:oci8:@ #sqlj.url=jdbc:oracle:oci7:@ # User name and password here (edit to use different user/password) sqlj.user=scott sqlj.password=tiger
The version of this file in [Oracle Home]/sqlj/demo
is configured to use the JDBC OCI8 driver and scott/tiger
schema. This is appropriate for the sample applications in this chapter, presuming you have a client installation as described in Chapter 2, "Getting Started".
For other uses, you must edit the file appropriately for your particular database connection.
A SQLJ translator properties file, such as sqlj.properties
below and in the demo
directory, can be used to specify translator options in translating the SQLJ demo applications. As is, the file does not enable online semantics-checking. To enable it, "uncomment" the sqlj.user
entries or add new sqlj.user
entries, as appropriate. An appropriate checker, either offline or online as applicable, will be chosen for you by the default OracleChecker
class.
In general, this properties file shows how to set numerous options, but settings are commented out.
For information about SQLJ properties files, see "Properties Files for Option Settings".
### ### Settings to establish a database connection for online checking ### ### turn on checking by uncommenting user ### or specifying the -user option on the command line #sqlj.user=scott sqlj.password=tiger ### add additional drivers here #sqlj.driver=oracle.jdbc.driver.OracleDriver<,driver2...> ### Oracle JDBC-OCI7 URL #sqlj.url=jdbc:oracle:oci7:@ ### Oracle JDBC-OCI8 URL #sqlj.url=jdbc:oracle:oci8:@ ### Oracle JDBC-Thin URL #sqlj.url=jdbc:oracle:thin:@<host>:<port>:<oracle_sid> #sqlj.url=jdbc:oracle:thin:@localhost:1521:orcl ### Warning settings ### Note: All settings must be specified TOGETHER on a SINGLE line. # Report portability warnings about Oracle-specific extensions to SQLJ #sqlj.warn=portable # Turn all warnings off #sqlj.warn=none # Turn informational messages on #sqlj.warn=verbose ### ### Online checker ### ### Force Oracle 7.3 features only (with Oracle 8i JDBC and 8i database) #sqlj.online=oracle.sqlj.checker.Oracle8To7JdbcChecker ### Force Oracle 7.3 features only (with Oracle 8.0 JDBC and 8.0 database) #sqlj.online=oracle.sqlj.checker.Oracle7JdbcChecker ### JDBC-generic checker: #sqlj.online=sqlj.semantics.JdbcChecker ### ### Offline checker ### ### Force Oracle 7.3 features only (with Oracle 8i JDBC) #sqlj.offline=oracle.sqlj.checker.Oracle8To7OfflineChecker ### Force Oracle 7.3 features only (with Oracle 8.0 JDBC) #sqlj.offline=oracle.sqlj.checker.Oracle7OfflineChecker ### JDBC-generic checker: #sqlj.offline=sqlj.semantics.OfflineChecker ### ### Re-use online checking results on correct statements ### #sqlj.cache=on ### ### Settings for the QueryDemo example ### ### shows how to set options for a particular connection context ### #sqlj.user@QueryDemoCtx=scott #sqlj.password@QueryDemoCtx=tiger #sqlj.url@QueryDemoCtx=jdbc:oracle:oci8:@ #sqlj.url@QueryDemoCtx=jdbc:oracle:oci7:@ #sqlj.url@QueryDemoCtx=jdbc:oracle:thin:@<host>:<port>:<oracle_sid>
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|