LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1068|回复: 1

載了很多號稱可以連接progress資料庫的jar文件...請問我該如何正確運用??

[复制链接]
发表于 2005-6-8 09:10:18 | 显示全部楼层 |阅读模式
[root@shlinux ROOT]# java ConnectMySQL
無法加載驅動程式:com.progress.sql.jdbc.JdbcProgressDriver
資料連接失敗!

import java.sql.*;
public class ConnectMySQL {
public static void main(String agrs[]){
String driver ="com.progress.sql.jdbc.JdbcProgressDriver";
String url ="jdbc:jdbcprogress:T:192.168.7.110:2551:adm";
try {
Class.forName(driver);
}
catch(Exception e) {
        System.out.println("無法加載驅動程式:"+driver);
}
}
我下載了很多號稱可以連接progress資料庫的jar文件...
我將其
export CLASSPATH=.:/usr/lib/jdk-1.4.2_03/lib/dt.jar:/usr/lib/jdk-1.4.2_03/lib/tools.jar:/usr/lib/jdk-1.4.2_03/lib/htmlconverter.jar:/usr/local/tomcat/webapps/ROOT/lib:/mis/mis/softwarez/java/progress.jar:/mis/mis/softwarez/java/jdbc.jar
CLASSPATH都指定了..
請問我該如何正確運用這些jar文件呢???
 楼主| 发表于 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.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表