-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Way to get the database name
PostPosted: Wed May 31, 2006 6:56 am 
Beginner
Beginner

Joined: Mon Mar 14, 2005 4:16 pm
Posts: 27
Hi, is there a way to get the database name without having to parse the database url? For instance, I would want to get "mydb" if using a url like this:
jdbc:oracle:thin:@localhost:1521:mydb

Thanks!

Bruno


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 7:20 am 
Regular
Regular

Joined: Thu Sep 22, 2005 1:53 pm
Posts: 88
Location: Rio de Janeiro
Hi,
I am not sure waht you want to do bu....
You can get the JDBC connection like this:

Code:
session.connection();


The catalog name you can get by executing getCatalog();
on teh connection.

Good Luck

_________________
DonĀ“t forget to rate!


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 7:42 am 
Beginner
Beginner

Joined: Mon Mar 14, 2005 4:16 pm
Posts: 27
Thanks for the answer, but the problem is that connection.getCatalog() returns null in my case, when everything is properly configured. Are there any other alternatives?

Thanks,

Bruno


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.