avatar
question on JOIN on Oracle# Database - 数据库
l*r
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!
avatar
n*a
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!

avatar
l*r
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.
avatar
n*a
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

avatar
l*r
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

avatar
n*a
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!

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。