× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I know this is a little old, but I thought I would add something in case
you have not found the answer. 

The following is documentation on the library list, default library, and
naming parameters:

Library list

The server uses specified libraries to resolve unqualified stored
procedure names, and stored procedures use them to resolve unqualified
names. To specify multiple libraries, use commas or spaces to separate
individual entries. You can use *LIBL as a placeholder for the current
library list of the server job: * When the first entry is *LIBL, the
specified libraries are added to the current library list of the server
job * When you do not use *LIBL, the specified libraries replace the
current library list of the server job

Default schema

The server uses the default schema to resolve unqualified names in SQL
statements. For example, in the statement "SELECT * FROM MYTABLE", the
server looks only in the default schema for MYTABLE. You can specify the
default schema on the connection URL. When you do not specify the
default schema on the connection URL, the following conditions apply,
depending on whether you use SQL Naming or System Naming.

SQL Naming

When you do not specify the default schema on the connection URL: * The
first entry (unless it is *LIBL) becomes the default schema * When the
first entry is *LIBL, the second entry becomes the default schema * When
you do not set this property or when it contains only *LIBL, the user
profile becomes the default schema

System Naming

When you do not specify the default schema on the connection URL: * No
default schema is set, and the server uses the specified libraries to
search for unqualified names. * When you do not set this property or
when it contains only *LIBL, the server uses the current library list of
the server job to search for unqualified names

--------------

What this means is that if you want the database connection to use the
library list of the profile the connection is using to connect, then you
MUST have the "naming" param set to "system" and either specify "*LIBL"
for "libaries", or leave it blank (don't specify it). If naming is set
to "sql" (the default), then it will use the first library in the
library list as the default library, or the user profile name as the
default library if either *LIBL or no libraries were supplied. 







-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Anand, Rajesh
Sent: Friday, July 29, 2005 4:04 AM
To: Java Programming on and around the iSeries / AS400
Subject: RE: How to use LIBL in connection string.

        Can you please post the code.

        That would be very helpful.

        One thing that everyone has failed to reply to is the fact the
very first lib specified in the libraries property is
        set as default lib. So my unqualified sql statement only looks
for table name in this lib and doesn't search the
        LIBL. How puzzling?? Has anyone encountered this???

        I've now installed JDK1.4.2 and had previously JDK1.2. My java
pgm is called from a RPG.

        How does the system know which version of JVM to start as I've
not specified in any parms or don't know how to in
        RPG.

        Any ideas??? 

Rajesh Anand
Email:Rajesh_anand@xxxxxx


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Marc Nothum
Sent: 29 July 2005 08:19
To: CN=Java Programming on and around the iSeries/O=AS400
Subject: RE: How to use LIBL in connection string.



Hi,


I use the following code to pick up the library-list, as it is in the
AS400-job:

Properties prop = System.getProperties();
libListForm1 = prop.getProperty("java.library.path");

This gives a list in the following format:
/QSYS.LIB/QSHELL.LIB:/QSYS.LIB/CTL.LIB:/Q....

Then:
The string-sequences "/QSYS.LIB/" and ".LIB" have to be removed.
The ":" must be replaced by spaces.

The result is a list in a format to be used in jdbc, as: "QSHELL CTL
QTEMP
QGPL"

If needed, I can supply the code, I wrote to do the transformations.

To use this libl in the jdbc-connection:

Properties connProps = new Properties();
connProps.setProperty("naming", "system");
connProps.setProperty("libraries", libl); //libl is the previously
created
list, as "QSHELL CTL QTEMP QGPL"
connProps.setProperty("user", user);
connProps.setProperty("password", password);
Class.forName(driver);
connection = DriverManager.getConnection(dburl, connProps);


Maybe this helps,

Marc






"Anand, Rajesh" <Rajesh_Anand@xxxxxx>@midrange.com on 28/07/2005
22:27:36

Please respond to Java Programming on and around the iSeries / AS400
       <java400-l@xxxxxxxxxxxx>

Sent by:    java400-l-bounces@xxxxxxxxxxxx


To:    "Java Programming on and around the iSeries / AS400"
       <java400-l@xxxxxxxxxxxx>
cc:

Subject:    RE: How to use LIBL in connection string.


If I use Lib names separated by commas, then will my unqualified
sql will search this libl??

 According to the manual, no. It will assume the first lib as the
default lib for any unqualified sql statement.

 I want to avoid using hard coded libl all together and I want
the unqualified sql statement to search the libl of the
 job calling the Java pgm.

 I think what Ashish is doing is what I want to achieve. Just
thought it might be possible to specify the user libl in
 the connection string.

 maybe not!!!

 rgds,

Rajesh Anand
Email:Rajesh_anand@xxxxxx


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Franco Biaggi
Sent: 28 July 2005 19:20
To: Java Programming on and around the iSeries / AS400
Subject: Re: How to use LIBL in connection string.


This work fine from long time ago:

DatabaseURL=jdbc:as400://10.1.1.1;transaction
isolation=none;naming=system;libraries=lib1,lib2,qgpl,qtemp;block
size=128;extended dynamic=true;package=MYPKG;package cache=true;package
library=qgpl

--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy,
retain
or redistribute it. Click here for important additional terms relating
to
this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------

--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.