Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

returning path of database from a connection 1

Status
Not open for further replies.

msloan

Programmer
May 30, 2001
39
US
I have a user defined System DSN on the client machine. From there the user will specify the name of that DSN in my app. Is there any way to retrieve the path of the database that that DSN points to?

TIA
 
Can you try something like this, and let me know your results...(I can not test it out..currently).

Code:
DatabaseMetaData dbMetaData = aConnection.getMetaData();
ResultSet rs = dbMetaData.getTables(null,null, null, null);
System.out.println(rs.getString(1));
 
after adding a try/catch block and calling rs.next(), worked great!!!

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top