• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

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.

0
jerelw
Asked:
jerelw
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now