RealSQLDriver
The Driver interface interacts with
the DriverManager. A client application should not call the methods in
RealSQLDriver directly, but should call them via the DriverManager class.
(The javadoc for the DriverManager class can be found at
http://java.sun.com/products/jdk/1.2/docs/api/java/sql/DriverManager.html
To establish a connection to a Reality database, an
application calls one of the three DriverManager.getConnection() methods, supplying a unique URL in the
format:
jdbc:realsql://host{:port}/database{;key=value,key=value}
Where:
-
hostis the network name of the remote system. -
portis the port number of the DDATCP listening port on the remote system. This is optional and if not supplied defaults to 1203. -
databaseis the database name defined on the remote system. It can be found in the ROUTE-FILE on Unix or the Registry on Windows systems. -
key=valuemay contain the following properties:-
useris the userid on the remote host and database
-userpwdis the user password on the remote host and database
-accountis the Reality account where the SQL server will logon
-accountpwdis the Reality account password, if one exists
-logLeveldefines the level of diagnostic information to be traced
-logOptionsapplies additional tracing information if required
-logModulescontrols which modules are traced
-hostOptiondefines server tracing if required
-HostItemNamesets the item name in the Reality logfileSQLSRVLOG(for more information on the last five properties, see Diagnostics)
The key=value pairs are defined as optional,
but a connection will not be successful
without at least a user-id, user password and account name.
The three getConnection() methods in DriverManager provide three alternative ways in which the properties can be supplied. The Connection
Examples illustrate the three ways: Method A appends all of the information to
the URL; Method B and the full Example Application
build a java.util.Properties
object to pass the connection properties; Method C appends the account, account
password and a logging property to the URL, then passes the URL, plus separate user and user
password identifiers, to getConnection().
The request
is packaged and forwarded to the RealSQLDriver.connect() method. The connection
URL is parsed and validated and a new Connection object is created, at which
point the connection to the database is established.