setCatalog to more than one database

Is there any way to load more than one database into a Connection?

setCatalog seems to only allow one database to be loaded at a time.

LVL 3
jerelwAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

whardemanCommented:
Each connection to a database in MySQL is an independent entity represented as a resource link. You can obviously connect to multiple databases, however each connection can only be to one database.

I assume you are referring to the JDBC method setCatalog. I'm not really familiar with JDBC, but after some quick googling, it seems that the Connection object itself can only reference one database. I assume that--as in most db api's--connecting to another database would require instantiating another Connection object.

More detail (or possible correction) is going to have to come from a true JDBC expert. =)

Hope this helps,

W
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jerelwAuthor Commented:
Thank you.

I'm looking for something similar to SYSTEM naming on the AS/400, where libraries can be assigned to each user based on the user id and can be accessed without the db_name. prefix.

Is SYSTEM naming unique to IBM?

0
jerelwAuthor Commented:
Is there anything similar to SYSTEM naming for MySQL?
0
whardemanCommented:
Unfortunately, I'm aware of no such functionality in MySQL. All my experience suggests that a connection must be explicitly made for each database involved.

Sorry. =)

W
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.