aspose file tools
The moose likes JDBC and the fly likes how to get Database name from connection object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how to get Database name from connection object" Watch "how to get Database name from connection object" New topic
Author

how to get Database name from connection object

somenath chatterjee
Greenhorn

Joined: Mar 20, 2008
Posts: 16
Hi,

I am using odbc5.jar(thin driver) for create connection with oracle database.
Now i want to get database name from connection object.
like in seq-server we use - connection.getCatalog().
but in oracle its return null.
please reply me if anybody know its solution.

thank you.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You can do it with DatabaseMetaData. Have a look at the methods that class gives you.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to get Database name from connection object
 
Similar Threads
Connecting to multiple databases using different jdbc drivers
oracle conneciton from connection object returned form connection pool
data base alias name
Updating database from Servlet
java.lang.ClassCastException when invoking jdbc stored procedure call