By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,492 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,492 IT Pros & Developers. It's quick & easy.

how to know database details via java program

P: 36
hi,
my name is shailesh,recently i was asked to find the database details(version,name etc) via a java program.

please help me


shailesh
Aug 7 '07 #1
Share this Question
Share on Google+
4 Replies


dmjpro
100+
P: 2,476
hi,
my name is shailesh,recently i was asked to find the database details(version,name etc) via a java program.

please help me


shailesh
Welcome to TSDN!!!

Expand|Select|Wrap|Line Numbers
  1. Connection l_con = null;
  2. //Code for getting the database connection.
  3. DatabaseMetaData databse_dtls = l_con.getMetaData();
  4.  

Now see the interface reference of DatabaseMetaData.
I am sure that you will get all the informations about the database.
Wish you a best of luck.

Kind regards,
Dmjpro.
Aug 7 '07 #2

100+
P: 201
Hi
execute following line
select * from nls_database_parameters
use our database connectivity and you will get complete detalis of database
Aug 7 '07 #3

10K+
P: 13,264
Hi
execute following line
select * from nls_database_parameters
use our database connectivity and you will get complete detalis of database
What database does that work on? I think dj's method is better because it's database independent.
Aug 7 '07 #4

100+
P: 127
A word of caution.
Though DatabaseMetaData gives you the information about the Database, its version, Driver information etc, its costly! Tend to minimize its use until its really necessary.
Aug 8 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.