简体   繁体   中英

Java Connect to Oracle Rdb Driver and execute query

I have been asked to translate an automation code from VisualBasic into java 8.

This is the old code:

connectionString = "Provider=MSDASQL;" & _
                        "FileDSN=" & dsn & ";" &  _
                        "DATABASE=Attach 'filename aaa$db';" & _
                        "UID=aaa$client;" & _
                        "PWD=" & psw
                        'log.Message connectionString
    
  Set connection = Sys.OleObject("ADODB.Connection")
  connection.ConnectionString = connectionString
  Call connection.Open

The idea is to query via oracle.rdb.jdbc.rdbnative.Driver, but I get ClassNotFoundException or via Jsch given the db reside on an OpenVMS system, but multiple commands don't work.

This is the old schema of the DSN file used for visual basic.

[ODBC]
DRIVER=Oracle Rdb Driver
CSO=1
XPT=2=tcp/ip
DATABASE=attach 'filename aaa$db'
CLS=generic
SVR=1.1.1.1
DBA=W
TLO=O
SERVER=1.1.1.1@generic@123456789@W

Any ideas to solve my problem?

The Rdb native driver is for using on OpenVMS systems.

Since you are replacing a VB program, I assume you are running your Java program on Windows. For this, you will need to use the Rdb Thin JDBC driver. Also, this driver requires a JDBC server be set up and run from the OpenVMS side - so hopefully you have someone who can set this up for you. (The JDBC driver does not use the same servers as the Rdb ODBC driver).

It's been a few years since I played with this, but a quick search shows there are plenty of resources on the internet. Another good resource is the Oracle Rdb list server ( http://www.jcc.com/resources?id=9 ) - the engineer responsible for the JDBC stuff will often answer questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM