|
I can probably help explain this (I wrote the code). Before v5r1, we did no library list processing whatsoever. Our default library support is accomplished by calling the CLI specifying the default library. The plural property name libraries was used to match the relatively similar functionality from the Toolbox JDBC driver which came out first. In v5r1, I added support for a more full featured libraries property. You can now specify a list of libraries seperated by colons, spaces or commas. As long as you are running in system naming mode, this list of libraries will get added to your library list. I don't monkey with the library list of a job with SQL naming because, in general, SQL naming mode does not look at the library list. Don't forget that adding a library to the library list of a job yourself is a reasonably easy task. Here is a rough example of how you could do this yourself: Statement s = connection.createStatement(); String libName = "MYLIB"; // 14 is the length of the command without the library name. // Add the library name length. String strLength = Integer.toString(libName.length() + 14); // Create the 10 character string length. strLength = "0000000000" + strLength; strLength = strLength.substring(strLength.length() - 10); // Create the command. String sqlString = "CALL QSYS/QCMDEXC('ADDLIBLE LIB(" + libName + ")', " + strLength + ".00000)"; try { s.executeUpdate(sqlString); } catch (Exception e) { System.out.println("Warning: Adding library " + libName + " to the server job library list failed."); } Regards, Richard D. Dettinger AS/400 Java Data Access Team "Biologists have a special word for stability -- dead" Larry Wall Open Source Developers Journal Issue 1, Jan 2000 sepp.muegeli@dvbern.ch@midrange.com on 07/06/2001 10:55:57 AM Please respond to JAVA400-L@midrange.com Sent by: owner-java400-l@midrange.com To: JAVA400-L@midrange.com cc: Subject: JDBC and Library-List Hi all I have a question about using the library list with jdbc and toolbox/native jdbc driver. I connect to the AS/400 with the properties: naming=system libraries=EVKTST When I run my jdbc application on my PC and connect to the AS/400 with the toolbox-driver, a job named QZDASOINIT is created to handle the requests. When I display the library list of this job, I see that the library EVKTST has been added to the library list. Thats fine. When I run the application on the AS/400 using the native driver, a job named QSQSRVR is created to handle the requests. This job does not have the library EVKTST in its library list. It will still find the files in the library, because it uses this library as the default library. I need to have the library in the library list of the job, because I'm calling a stored procedure and this stored procedure will not find the files if the library is not in the library list. With the toolbox driver the stored procedure is running fine, but with the native driver the stored procedure can't find the files. In <http://www.as400.ibm.com/developer/jdbc/Faqs/JDBCFAQ.html#B8> I found this text: ______________________________________________________________________ Property: naming Values: "sql", "system" Meaning: This property allows you to use either the traditional AS/400 naming syntax or the standard sql naming syntax. "system" naming means that you should use a "/" character to separate collection and table values, and "sql" naming means that you should use a "." character to separate the values. The setting of this value has ramifications for what the default library is also. See the "libraries" property for further information on this. The default is to use "sql" naming. ______________________________________________________________________ Property: libraries Values: anything Meaning: This property is a little deceptive. It's name implies that it is plural, but the native JDBC driver only allows one library to be specified. That one library, if provided will be set as the default library. This default library will be used as the intended library for all references in SQL statements that are not qualified. The "naming" property has an effect on how this property will work if it is not explicitly set. In the default case, where "naming" is set to "sql", JDBC works like ODBC. The default library is the same name is the user profile. If the case where "naming" is set "system", the default library will be the top library in the users library list. There are restrictions on how this work. See the entry on using a library list found elswhere on this site. ______________________________________________________________________ Does anybody have an idea why I can not set the library list using the native driver? Sepp Mügeli DV Bern AG ______________________________________________________________________ mailto:sepp.muegeli@dvbern.ch / http://www.dvbern.ch Briefpost: Sulgenauweg 40 , CH-3007 Bern Telefon: ++41+31 378 24 54 Telefax: ++41+31 378 24 74 . +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
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.