检索iASP RDB名称以在jdbc url中指定它 [英] Retrieve iASP RDB name to specify it in jdbc url

查看:103
本文介绍了检索iASP RDB名称以在jdbc url中指定它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在IBM i上运行的Java应用程序.它使用jdbc创建到AS400数据库的连接.它没有在JDBC连接URL中指定数据库名称,意味着它创建了与* SYSBAS关联的默认系统数据库的连接.

I have a java application which runs on IBM i. It creates connection to AS400 database using jdbc. It does not specify the database name in JDBC connection URL, means it creates connection to default system database associated with *SYSBAS.

现在,我希望我的应用程序可以在iASP上运行.在iASP上运行时,它无法连接到数据库.

Now I want my application to run on iASP. When running on iASP it fails to connect to database.

IBM i文档说,我们必须在数据库名称"目录中指定RDB名称.连接的jdbc连接URL的属性.

IBM i documentation says that we must specify RDB name in "database name" property of jdbc connection URL to connect.

这里的问题是

IBM i文档说,默认情况下,iASP组的RDB名称与iASP组中的主要iASP设备名称相同.但是可以为其指定其他名称.

IBM i documentation says by default RDB name of iASP group is same as primary iASP device name in iASP group. But it can be assigned different name.

我能够使用JTOPEN(通过调用API QUSROBJD)以编程方式检索iASP组名称和iASP设备名称.这意味着我的应用程序将在默认情况下运行.但是,当为RDB名称分配其他名称时,我的应用程序可能会失败.我想检索与iASP关联的RDB名称.

I am able to retrieve iASP group name and iASP device name programmatically using JTOPEN(by calling API QUSROBJD). Which means my application will work in default scenario. But when RDB name is assigned different name then my application may fail. I want to retrieve RDB name associated with iASP.

如何为iASP检索正确的RDB名称?

How can I retrieve correct RDB name for an iASP?

我尝试使用API​​ QUSRJOBI,但返回的数据库名称为空.

I tried using API QUSRJOBI, but it is returning database name as blank.

推荐答案

IBM i上有两种类型的辅助存储池(ASP):系统ASP和独立ASP(iASP).在DB2 for i上,系统ASP中的所有库都被视为一个数据库,您可以使用模式名称限定表以访问特定库中的表.根据我发现的文档,每个新的iASP都会创建一个新的数据库,可以在QSYS2.SYSCATALOGS中对其进行查询.因此,您将需要与系统数据库的连接,然后,您可以找到数据库名称并连接到需要连接的每个iASP.不幸的是,由于我没有可用的iASP,因此我无法对此进行测试.

There are two types of Auxiliary Storage Pool (ASP) on IBM i: System ASPs and independent ASPs (iASP). On DB2 for i, all libraries in the system ASP are treated as a single database and you can qualify tables with a schema name to access a tables in a specific library. According to the documentation that I found, each new iASP creates a new database, and these can be queried in QSYS2.SYSCATALOGS. So you will need a connection to the system database and, from that, you can find the database name and connect to each iASP that you need a connection to. Unfortunately I cannot test this as I do not have an iASP available to me.

这篇关于检索iASP RDB名称以在jdbc url中指定它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆