1

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?

MT0
  • 143,790
  • 11
  • 59
  • 117
Emtec
  • 11
  • 1

1 Answers1

0

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.

ChrisB
  • 96
  • 2
  • Thank you for your answer! There is a method to call Rdb ODBC driver via JAVA? Or enter to DB via shell with jsch? – Emtec Jul 02 '20 at 08:19
  • I suppose you could try using a JDBC - ODBC bridge to connect to Rdb, but I can't say I have tried it. If jsch allows you to logon to the Rdb server (ie. as a terminal emulator) using a username that has access to the database, then yes you can use command line SQL to query database. That would not be useful from a programming perspective however. – ChrisB Jul 03 '20 at 00:43