This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connecting to Multiple Schemas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connecting to Multiple Schemas" Watch "Connecting to Multiple Schemas" New topic
Author

Connecting to Multiple Schemas

pownraj kasi
Greenhorn

Joined: Jul 19, 2006
Posts: 7
Hi,
I have a task to update records in multiple tables on multiple database.

Ex)

I need to update

1)Employee table in ASM database
2)Manager Table in ACD database.

My doubt is for each database i need to create seperate connection or is it possible to use same connection for multiple databases?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Hi, are these schemas stored in the same database?
If yes, then it is possible for most databases to create a database user that can access both schemas.

In that case, you can do with one connection. You will gave to put the schema name in front of the table name to make it work.

Example:

insert into ASM.Employee (....
insert into ACD.Manager (....


(note that you are confusing us a bit in your post: the title says: 'multiple schemas', the detail says 'multiple databases'.)


OCUP UML fundamental and ITIL foundation
youtube channel
pownraj kasi
Greenhorn

Joined: Jul 19, 2006
Posts: 7
Thanks for your reply.

sorry.It is multiple schemas from same database.

but i don't have the permission to create an user for acessing both schemas.

in this case it is possible to use same connection?.

Thanks in advance
Pownraj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to Multiple Schemas
 
Similar Threads
Display one record per current date
Multiple Row Updation
SQL Exception Connection is busy with results for another hstmt.
How to Update multiple rows of a table in jsp
how to update multiple table in frame