Progress
JDBC Driver Guide
Connecting to a Database
JDBC applications must perform two steps to connect to a database:
Loading the JDBC Driver Using Class.forName
The Class.forName method takes as its argument the fully qualified class name of the JDBC Driver. If it finds the class, the method loads and links the class, and returns the Class object representing the class. The fully qualified class name for the Progress SQL-92 JDBC Driver is com.progress.sql.jdbc.JdbcProgressDriver.
To load the JDBC Driver, use it as the argument to the Class.forName method:
Using DriverManager.GetConnection
To connect to a Progress database through the JDBC Driver, an application specifies:
Applications specify this information as arguments to the DriverManager.GetConnection method.
Java URL Connection String
DriverManager.GetConnection requires at least one argument, a character string specifying a database connection URL. For the Progress SQL-92 JDBC Driver, the URL has the following syntax:
The URL string has the following components:
jdbc:JdbcProgress:T
An identifying subprotocol string for the JDBC Driver.
host-name
The name of the system where the Progress SQL-92 JDBC data source resides.
port#
Port number or service name to be used for the connection.
database-name
The physical file name of the Progress database.
User-ID
The User ID for connecting to the database.
Password
The password for connecting to the database.
EXAMPLEWhen passed to DriverManager.GetConnection, the URL
jdbc.JdbcProgress:T:isis:2000:testdb
specifies that the JDBC Driver be used to connect to the database testdb on the server named isis.User Authentication Detail
DriverManager.GetConnection accepts three variants of user authentication detail:
NOTE: The JDBC Driver expects the keys of the Properties object to be named user and password when it processes the object. Application code must use those names when it populates the Properties object:
EXAMPLEThe following code sample loads the driver and connects to the database testdb, using the form of DriverManager.GetConnection that takes authentication information as a single Properties object:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |