aspose file tools
The moose likes JDBC and the fly likes connecting to different libraries in db2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "connecting to different libraries in db2" Watch "connecting to different libraries in db2" New topic
Author

connecting to different libraries in db2

lynn ng
Greenhorn

Joined: Aug 07, 2007
Posts: 6
Hi,
I need to join table in two different libraries in DB2 database.
How to open connection to different libraries?
I think "schemaName" is the name of the libraries, doesn't it?
I would like to open another connection to another libraries.
Do I have to create another connection class?

String url = ""jdbc:as400://datasource//schemaName"
Driver drive = DriverManager.getDriver(url);
Connection con = drive.connect(url,pp);

Thank you,
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Yes, it's as easy as creating another connection. You can connect to several databases at once. Give it a shot and show us what you make!

BTW: I'm not familiar with the term "library" in this context. Do you just mean two databases?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12911
    
    3

"lynn ng",

Please check your e-mail.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connecting to different libraries in db2
 
Similar Threads
Tomcat DBCP: Problem with first update statement after Tomcat restart
Kyle's 2nd ED
Comparing two tables of different database
JDBC-ODBC(VERY VERY URGENT PLEASE)
Could not create connection