cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle Connection info from Data Source

Former Member
0 Kudos

Hi.

I created Data Source for oracle DB in SAP J2EE WAS and I want to get connection information from this data source. (For example, Connection URL)

Because I going to show this connection information from my portal application.

Any ideas ?

Regards, Arnold.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi EP,

Have you got the solution?

Or else let me know, I'll try to give you more suggestions.

Hope it helps.

Regards,

Karthick

Award points in sdn for helpful answers.

Former Member
0 Kudos

Hi Karthick.

It works and I have one more question.

I got URL information from DatabaseMetaData Object and I want to get User ID / Password too.

Is it possible ?

Regards, Arnold.

Former Member
0 Kudos

Hi EP,

you can get the User Namelike this..

meta.getUserName();

You can get lot of Information (Schema,column count etc..)from DataBaseMeta object.

Hope it helps.

Regards,

Karthick

Former Member
0 Kudos

Hi EP,

public String getUrl(String db) {

String url = " ";

Connection con = null;

try {

String dataSourceName = null;

dataSourceName = "***"; //Give your data source name

con = MyConnection.getConnection(dataSourceName);

if (!(con == null || con.isClosed())) {

DatabaseMetaData meta = con.getMetaData();

url = meta.getURL();

}

return url;

} catch (Throwable t) {

return url;

} finally {

try {

MyConnection.closeConnection(con);

} catch (SQLException e) {

Logger.log(Severity.ERROR,"Error while Testing connection");

}

}