MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » February 2013

Re: Starting to experiment with Scott Klement's JDBCR4 -- what's the DB2/400 equivalent to MySQL "USE"



fixed

Thanks, Scott and Coy; "SET SCHEMA" worked, and the test program got as far as creating and populating RPGTEST.

But then I ran into another error that really blew things up: DB2/400 didn't like the double quotes in the test query, and I ended up with multiple dumps going both to STDOUT and to spool files. As soon as I changed them to single quotes, everything worked perfectly.

Hmm. So MySQL "USE FOO" and DB2/400 "SET SCHEMA FOO" are more-or-less equivalent. And DB2/400 doesn't like "USE FOO," and it appears that MySQL doesn't like "SET SCHEMA FOO."

That adds complexity to the task of writing something that can talk to any database that has a JDBC driver. Then again, now that I think about it, the nature of my project suggests that I'm either going to be fully qualifying every table name, every time I call anything that takes a table name, or specifying the schema when opening the connection. (Which would work better?)

And Scott: Thanks for your detailed response Now that the immediate problem is solved, I'm going to re-read it in depth, in order to learn as much as I can from it. How are you feeling?

--
JHHL





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

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact