l***r 发帖数: 459 | 1 Greetings,
Can I do JOIN between different database in oracle? I know it can do between
different schema for sure. But not sure for different databases.
Thanks in advance! | n********a 发帖数: 68 | 2 use db link.
【在 l***r 的大作中提到】 : Greetings, : Can I do JOIN between different database in oracle? I know it can do between : different schema for sure. But not sure for different databases. : Thanks in advance!
| l***r 发帖数: 459 | 3 Does JDBC support that?
I Google it and found this
http://www.roguewave.com/support/docs/xml/xdbug/1-1.html
It seems JDBC doesn't support it, right? Since my product is Java based, does
any XML package support this?
Thanks!
between
【在 n********a 的大作中提到】 : use db link.
| n********a 发帖数: 68 | 4 The link you referred is not the same DB link I referred to.
In oracle, you can create Database Link object.
CREATE DATABASE LINK sales.hq.acme.com
CONNECT TO hr IDENTIFIED BY hr
USING 'sales';
Of course, you have to setup Oracle Net properly to have the
correct Net Service Name.
Then you can do:
SELECT * FROM e*******[email protected];
Of course, JDBC supports it. It's purely SQL. Just write
PreparedStatement ps = con.prepareStatement("SELECT * FROM
e*******[email protected]");
Detail
【在 l***r 的大作中提到】 : Does JDBC support that? : I Google it and found this : http://www.roguewave.com/support/docs/xml/xdbug/1-1.html : It seems JDBC doesn't support it, right? Since my product is Java based, does : any XML package support this? : Thanks! : : between
| l***r 发帖数: 459 | 5 Thanks. I believe this should work.
I create a database link and succeed. However, I test it and the message say
"database link is not active". I think the service name should be right. Do
you have any idea about this?
Thanks again!
【在 n********a 的大作中提到】 : The link you referred is not the same DB link I referred to. : In oracle, you can create Database Link object. : CREATE DATABASE LINK sales.hq.acme.com : CONNECT TO hr IDENTIFIED BY hr : USING 'sales'; : Of course, you have to setup Oracle Net properly to have the : correct Net Service Name. : Then you can do: : SELECT * FROM e*******[email protected]; : Of course, JDBC supports it. It's purely SQL. Just write
| n********a 发帖数: 68 | 6 It could be, as you guessed, net service name is not setup properly
or simply the username/password used is not authenticated.
To figure this out, look for the error code.
If you are in SQLPlus, you should see the error code starting with ORA-.
If you use JDBC, you should be able to get it by
java.sql.SQLException.getErrorCode()
And look up the error code in the Oracle Error Messages documentation.
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a
96525/toc.htm
【在 l***r 的大作中提到】 : Thanks. I believe this should work. : I create a database link and succeed. However, I test it and the message say : "database link is not active". I think the service name should be right. Do : you have any idea about this? : Thanks again!
|
|