Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connecting to different libraries in db2

 
lynn ng
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15636
46
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"lynn ng",

Please check your e-mail.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic