Try this one

rc = JDBC_ExecUpd( conn : 'set schema testsck' );

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: Friday, February 01, 2013 17:10
To: Midrange Systems Technical Discussion
Subject: Re: Starting to experiment with Scott Klement's JDBCR4 -- what's the DB2/400 equivalent to MySQL "USE"

On 2/1/13 3:33 PM, Vernon Hamberg wrote:
USE sets the current database - on the i, a library is the same thing
as what MySQL and others call a database.

There is a SET OPTION DFTRDBCOL schema-name that gets you the same

Or you can set naming convention in JDBC to SQL and set the default
collection there.


I replaced
rc = JDBC_ExecUpd( conn : 'Use testsck' ); with rc = JDBC_ExecUpd( conn : 'SET OPTION DFTRDBCOL TESTSCK' );

and even though by the time the exception is thrown, the TESTSCK library does exist, I still end up with:
RPG procedure JDBC_EXECU in program JDBCR4/JDBCR4 received Java
exception "java.sql.SQLException: [SQL0204] TESTSCK in *N type *LIB
not found." when calling method "executeUpdate" with signature
"(Ljava.lang.String;)I" in class "java.sql.Statement".

followed, confusingly, by:
RPG procedure JDBC_EXECU in program JDBCR4/JDBCR4 received Java
exception "java.sql.SQLException: [SQL0104] Token TESTSCK was not
valid. Valid tokens: =." when calling method "executeUpdate" with
signature "(Ljava.lang.String;)I" in class "java.sql.Statement".

Not quite sure what to make of it.

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at

This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or taking any action based on it, is strictly prohibited.

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page