*
The moose likes JDBC and the fly likes JDBC-ODBC Drivers ...Again Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC-ODBC Drivers ...Again" Watch "JDBC-ODBC Drivers ...Again" New topic
Author

JDBC-ODBC Drivers ...Again

Subramanian Parlikkad
Greenhorn

Joined: Oct 13, 2000
Posts: 3
Is anybody there? It would be great help if somebody would answer my earlier post. I need to list all the ODBC drivers and System DSNs in a system using Java-JDBC? Any ideas??
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
try
http://java/sun/com/products/jdbc
catch
List Drivers Available
hope this helps....

------------------
We learn more from our mistake's than from our success's.

[This message has been edited by Monty Ireland (edited October 18, 2000).]


Multi Platform Database Developer & DBA on E.S.T.
Subramanian Parlikkad
Greenhorn

Joined: Oct 13, 2000
Posts: 3
My question was 'what API should I use to list the ODBC drivers registered in a server from a Java application'.
Joe Paolangeli
Ranch Hand

Joined: Apr 05, 2000
Posts: 73
I have not tried this out but you can get an enumeration of drivers through the DriverManager class. There is a static method named "getDrivers()" that will handle this.
Subramanian Parlikkad
Greenhorn

Joined: Oct 13, 2000
Posts: 3
DriverManager.getDrivers() only returns the drivers that are loaded earlier using class.forname(xx). I want the list of all drivers and DSNs in the system(server). In VB one uses SQLDrivers API to do this. I want a similar JDBC API in Java.
[This message has been edited by Subramanian Parlikkad (edited October 27, 2000).]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Since drivers are simply classes, aren't registered with anything, and don't even have to directly be on the classpath, how would Java know which drivers even exist on the server?
[This message has been edited by Thomas Paul (edited October 30, 2000).]


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
say again...
unless you are using the jdbc-odbc driver that comes with the standard jdk. you have to put a vendors __.zip or __.jar file within you CLASSPATH. Otherwise you will an exception...
this post has show to me that ... we all need to review
some tutorials and/or read a good book...
this a basic stuff here ...
it is not rocket science...



[This message has been edited by Monty Ireland (edited November 03, 2000).]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Well, Monty, I see that maturity is not your strong point. If you can not post according to the guidelines, you will be banned.
Just to correct you, many vendors (Sybase for example) supply their classes as classes in addition to supplying them as a jar or zip file. This is what I meant when I said that the classes don't have to be "DIRECTLY" on the classpath. They could be many directories off the classpath.
But this does not change the answer to the question which is that Java does not know what JBDC drivers are available on the server. It can only tell you what drivers are registered.
[This message has been edited by Thomas Paul (edited October 31, 2000).]
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
We learn more from our mistake's than from our success's.
...
Do NOT get bend out of shape one this one...
I did not mean to offend anyone.
...
6 months ago I would not have recieved a reply like this one...
...
I will try to be more P.C. next time.
...
I'm here to learn and help others...
SeeYa Later Partner
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JDBC-ODBC Drivers ...Again
 
Similar Threads
advantage of JDBC drivers over JDBC-ODBC bridge
JDBC in Solaris
Problem with JdbcOdbcDriver
Facing Big Problem with Sql Server 2000 Odbc Driver
Jar file for JDBC...