|
楼主 |
发表于 2005-6-12 16:51:31
|
显示全部楼层
NOTE:
It is assumed that you have some knowledge of Java and JDBC,
if writing an application,and some knowledge of how to set enviroment variables.
It is also assumed that the Progress JDBC driver,Java 2 Platform Standard Edition
Software Development Kit (J2SE. SDK),Java 2 Runtime Environment (J2RE),
and Java Virtual Machine (JVM) are already installed.
Progress uses a Type 2 JDBC driver supplied by DataDirect.
Technologies.A Type 2 driver is a native-API ,partly Java driver.
"Native-API" means that the driver converts JDBC calls into client API calls for a particular database vendor.
"artyly Java" means the driver contains Java code that uses the JNI to call the database vendor's client APIs.
One of these JDBC API calls must be to either the DriverManager.getConnection method or the DataSource.getConnection method.
The getConnection method obtains a connection to the appropriate JDBC driver.
the DriverManager or DataSource class is used to manage that connection.
Java Application
JDBC API
JDBC DriverManager or DataSource Object
Progress Type 2 JDBC Driver
(
jdbc.jar
JdbcProgress Library
)
Progress Client Library
procli92 Library
Client
Server
network or direct connection
Progress SQL-92 Server
Storage Engine
Progress Database
Figure 1
The jdbc.jar file contains the classes for Progresss JDBC driver,the com.progress.sql.jdbc package and the com.progress.sql.jdbcx package.
The jdbc.jar file interacts with the JDBC API layer.
The JdbcProgress file interacts with the Java code,in the jdbc.jar file,and the Progress client library file.
The procli92 file contains code that talks over the network to the Progress SQL-92 server.
The SQL-92 server interacts with the Progress Database using the Storage Engine.
All the client pieces shown in Figure 1 , with the exception of the Java application,are available from Progress by installing the Progress SQL-92 Client Access Product.
The JDBC client is supported on Windows , Linux .....
Table 1 : JDBC Driver Components
Platform Files and Location
Windows $DLC\java\jdbc.jar
$DLC\bin\JdbcProgress.dll
$DLC\bin\procli92.dll
Linux $DLC/java/jdbc.jar
$DLC/lib/libJdbcProgress.so
$DLC/lib/libprocli92.so
Table 2: JDBC APIs Supported by the Progress JDBC Driver
jdbc package jdbcx package
CLASS CLASS
DriverManager ConnectionEvent
DriverPropertyInfo INTERFACE
Types DataSource
Date ConnectionPoolDataSource
Time PooledConnection
Timestamp ConnectionEventListener
INTERFACE
Driver
Connection
DatabaseMetaData
CallableStatement
PreparedStatement
Statement
ResultSet
ResultSetMetaData
EXCEPTION
BatchUpdateException
SQLWarning
SQLException
DataTruncation
Environment Variables
A Type 2 JDBC driver requires that both the CLASSPATH and the library path be set on each client machine.
The CLASSPATH points to the location of Progresss' JDBC driver classes.
The library path points to the location of the JdbcProgress library and Progress' client library (procli92).
Table 3: Environment Variables
Windows NT CLASSPATH $CLASSPATH;$DLC\java\progress.jar
PATH $PATH;$DLC\bin
Linux X86 CLASSPATH $CLASSPATHDLC/java/progress.jar
LD_LIBRARY_PATH $LD_LIBRARY_PATHDLC/lib
NOTE:The progress.jar file provides access to the classes in the jdbc.jar file.
To set an enviroment variable on Linux , use the following command as an example.
CLASSPATH=$CLASSPATHDLC/java/progress.jar;export CLASSPATH
Another way to set an environment variable WINDOWS is to choose Start-->Settings-->ControlPanel-->System-->Environment.
Place the cursor in the Variable field and type CLASSPATH.
Place the cursor in the Value field and type %CLASSPATH%;%DLC%\java\progress.jar.
Connecting to a Progress Database with a JDBC Driver
This section describes how to connect to a Progress database through a JDBC driver in two contexts,from the Progress SQL Explorer tool and from a Java application. |
|