On 10-Oct-2016 09:18 -0500, Chamara Withanachchi wrote:
I want to setup LIBL using the JT400 driver, tried using libraries
property but no luck, does anyone have experience on this, if
possible share a sample code for this.
Apparently, for Database access using the JDBC driver.?
[IBM i 7.2->Programming->Java->IBM Developer Kit for Java->Database
access from Java programs->Accessing your IBM i database with the Java
JDBC driver->Connections->JDBC driver connection properties]
(
http://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzaha/conprop.htm)
"…
*Property*: libraries
*Values*: A space-separated list of libraries. (A list of libraries can
also be separated by colons or commas.)
*Meaning*: This property allows a list of libraries to be placed into
the server job's library list or a specific default library to be set.
The naming property affects how this property works. In the default
case, where naming is set to sql, JDBC works like ODBC. The library list
has no effect on how the connection processes. There is a default
library for all unqualified tables. By default, that library has the
same name as the user profile that is connected. If the libraries
property is specified, the first library in the list becomes the default
library. If a default library is specified on the connection URL (as in
jdbc:db2:*local/mylibrary), that overrides any value in this property.
In the case where naming is set system, each of the libraries specified
for this property is added to the user portion of the library list and
the library list is searched to resolve unqualified table references.
…
*Property*: naming
*Values*: sql, system
*Meaning*: This property allows you to use either the traditional IBM i
naming syntax or the standard SQL naming syntax. System naming means
that you use a /(slash) character to separate collection and table
values, and SQL naming means that you use a .(period) character to
separate the values.
The setting of this value has ramifications for what the default library
is also. See the libraries property above for further information about
this.
The default is to use SQL naming.
…"
So just what was actually specified, and where? A reader can not know
that which is not shared. What happened with whatever-that-was, was
specified?; i.e. what determined\revealed\exhibited the effect of "no
luck"? For example, does the library name matching the user-name used
for the connection, become in effect, the Current Schema? Do perhaps
none or only the first of the libraries named\specified appear in the
user portion of the *LIBL, or perhaps just lower in the list than
expected; e.g. as seen in DSPLIBL or DSPJOB output? What was the Naming
option specified?
Any help from the example [with a minor redaction to name each
library distinctly] shown here? Not: I recommend against using the
"translate binary=true", and instead to correct the problem for which
that option might be chosen:
[RDI 9.5.1 Connection for DB2]
(
http://archive.midrange.com/wdsci-l/201610/msg00015.html)
"Below is what I use for a connection string: (names changed to protect
the innocent)
jdbc:as400:server.company.com;prompt=false;translate
binary=true;naming=system;date format=iso;libraries=LibNam1, LibNam2,
LibNam3, LibNam4, LibNam5, LibNam6, LibNam7;
Using 'libraries' allows me to use system naming and therefore a library
list like concept in the connection. Which further allows us to not
hardcode libraries in our SQLs. …"
Although not JT400, likely similar [despite the libraries property is
known to be distinct in behavior betwixt JT400 and JTOPEN]:
[IT infrastructure->Power Systems->Software->IBM i->Toolbox->
Toolbox for Java and JTOpen "JDBC frequently asked questions]
(www.ibm.com/systems/power/software/i/toolbox/faq/jdbc.html#faqC10)
As an Amazon Associate we earn from qualifying purchases.