• 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
Sheriff
Posts: 15759
74
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"lynn ng",

Please check your e-mail.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!