简体   繁体   English

使用Java从IBM i中获取DB2数据

[英]Fetching DB2 data from IBM i using Java

I need to fetch DB2 data from user libraries on an IBM i machine using Java. 我需要使用Java从IBM i机器上的用户库中获取DB2数据。 I'm using JTOpen400. 我正在使用JTOpen400。 Can anyone please help? 谁能帮忙吗?

You have to rephrase your question. 您必须重新表达您的问题。 RPGLE files does not exist on an iSeries. RPGLE文件在iSeries上不存在。 Everything is a DB2 table (which can be used with RPGLE offcourse). 一切都是一个DB2表(可以在RPGLE场外使用)。

If you have JTOpen400, then I advice to use JDBC. 如果您有JTOpen400,那么我建议您使用JDBC。 With JDBC the iSeries is a regular DB2 database server. 对于JDBC,iSeries是常规的DB2数据库服务器。 It works like any other database server. 它的工作方式与任何其他数据库服务器一样。 Just follow the JDBC guidelines as describes in many books, manuals and websites. 只需遵循许多书籍,手册和网站中描述的JDBC准则即可。

Check SequentialFile for this. 为此,请检查SequentialFile。 Remember to set the record format, and then you can pick out the fields for each line as you iterate them. 记住设置记录格式,然后在迭代它们时可以为每一行选择字段。

You can use JDBC (driver provided by JT400) to access DB2/400 files on the iSeries just like any other database. 您可以使用JDBC(JT400提供的驱动程序)来访问iSeries上的DB2 / 400文件,就像其他任何数据库一样。

The JDBC URL would be something like jdbc:as400://system-name/default-schema;properties JDBC URL类似于jdbc:as400://system-name/default-schema;properties

See http://javadoc.midrange.com/jtopen/com/ibm/as400/access/AS400JDBCDriver.html for more information. 有关更多信息,请参见http://javadoc.midrange.com/jtopen/com/ibm/as400/access/AS400JDBCDriver.html

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

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