• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Using Library Lists for JDBC File Access

    May 31, 2002 Timothy Prickett Morgan

    Hey, David:

    How do you set your library list with JDBC and JTOpen? The JDBC documentation says that I should use system naming along with a libraries property. When I do that, it appears that the search stops on the first library. The only way I can get a select statement that uses files from more than one library is to qualify the library name. That makes it difficult to test.

    BCD Int'l

    — James

    To be consistent with the way that the ODBC uses library names, the JTOpen 3.0 JDBC drivers take the first library that you specify and ignore the rest because the first library specified becomes the default library. To make the libraries property work the way you would expect, you have to specify a comma (,) at the beginning of the

    libraries

    property. The extra comma tells the JDBC driver that you do not want a default library and the libraries following the comma are searched in order.

    You can specify the connection properties like the libraries property as part of the URL on your JDBC URL. The IBM Information Center has a complete list of the available connection properties. For example, the following connection URL will cause JDBC to search three libraries:

    DriverManager.registerDriver
        (new com.ibm.as400.access.AS400JDBCDriver());
    conn = DriverManager.getConnection(
        "jdbc:as400://mySystem;naming=system;libraries=
        ,lib1,lib2,lib3")
    stmt = connection.createStatement();
    
    rs = stmt.executeQuery("select * from fileinlib1 
        join fileinlib2…");
    while (rs.next()) {
        String field1 = rs.getString(1);
     }
    

    After connecting with this connection URL, the SQL select statement will search libraries lib1, lib2, and lib3 in order looking for files.

    — David

    Sponsored By
    BCD INT’L

    BCD’s Web, and iSeries 400 Application Development Tools–won 10 industry
    Awards
    and have 1,000’s of developers.

    Need to extend your applications to the Web or create new ones—Fast ?

    Then try Award Winning WebSmart–Superior Technology that lets you create
    Web solutions fast, easy and affordably.

    –Get a FREE DOWNLOAD today–

    Run on iSeries 400 HTTP/Apache Server and / or Windows, Linux, Unix, AIX…Multi-platform / multi-server, one effort!

    Click & visit—www.BCDsoftware.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 42 -- May 31, 2002

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Prevent Someone Else from Peeking at Your Window 2000/XP System Proper Use of QTEMP

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 42

This Issue Sponsored By

    Table of Contents

    • A Better Way to Get Query/400 Definitions?
    • Odds and Ends
    • Using Library Lists for JDBC File Access

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • Meet The Next Gen Of IBMers Helping To Build IBM i
    • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
    • Will Independent IBM i Clouds Survive PowerVS?
    • Now, IBM Is Jacking Up Hardware Maintenance Prices
    • IBM i PTF Guide, Volume 27, Number 24
    • Big Blue Raises IBM i License Transfer Fees, Other Prices
    • Keep The IBM i Youth Movement Going With More Training, Better Tools
    • Remain Begins Migrating DevOps Tools To VS Code
    • IBM Readies LTO-10 Tape Drives And Libraries
    • IBM i PTF Guide, Volume 27, Number 23

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle