简体   繁体   English

Java 连接到Oracle Rdb驱动并执行查询

[英]Java Connect to Oracle Rdb Driver and execute query

I have been asked to translate an automation code from VisualBasic into java 8.我被要求将 VisualBasic 中的自动化代码翻译成 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.这个想法是通过 oracle.rdb.jdbc.rdbnative.Driver 进行查询,但我得到 ClassNotFoundException 或通过 Jsch 给定数据库驻留在 OpenVMS 系统上,但多个命令不起作用。

This is the old schema of the DSN file used for visual basic.这是用于 Visual Basic 的 DSN 文件的旧架构。

[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. Rdb 本机驱动程序用于 OpenVMS 系统。

Since you are replacing a VB program, I assume you are running your Java program on Windows.由于您要替换 VB 程序,我假设您正在 Windows 上运行 Java 程序。 For this, you will need to use the Rdb Thin JDBC driver.为此,您需要使用 Rdb Thin JDBC 驱动程序。 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.此外,此驱动程序需要从 OpenVMS 端设置和运行 JDBC 服务器 - 所以希望有人可以为您设置。 (The JDBC driver does not use the same servers as the Rdb ODBC driver). (JDBC 驱动程序不使用与 Rdb ODBC 驱动程序相同的服务器)。

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.另一个很好的资源是 Oracle Rdb 列表服务器( http://www.jcc.com/resources?id=9 ) - 负责 Z82269B9B71AB4A7732F6958610.214C 问题的工程师会经常回答问题44

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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