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?


This thread ...


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