Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unable to load JdbcOdbc library

41 views
Skip to first unread message

Yong QIan

unread,
Dec 30, 1999, 3:00:00 AM12/30/99
to
Newbie question.
I am trying the code under JAVA1.2. The code looks this:

String url = "jdbc:odbc:MOUSESTS";
String query = "SELECT * FROM emp";

Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection (
url, "my-user", "my-passwd");


After running on Solaris7, I get the following message. Can anyone help me
to
find out what was wrong? Thanks.

Yong

DriverManager.getConnection("jdbc:odbc:MOUSESTS")
trying
driver[className=sun.jdbc.odbc.JdbcOdbcDriver,sun.jdbc.odbc.JdbcOdbcDriver@1
e2dec9]
*Driver.connect (jdbc:odbc:MOUSESTS)
JDBC to ODBC Bridge: Checking security
No SecurityManager present, assuming trusted application/applet
JDBC to ODBC Bridge 1.2001
Current Date/Time: Thu Dec 30 15:34:55 EST 1999
Loading JdbcOdbc library
Unable to load JdbcOdbc library
java.sql.SQLException: Unable to load JdbcOdbc library
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(Throwable.java:94)
at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:82)
at sun.jdbc.odbc.JdbcOdbc.<init>(JdbcOdbc.java:88)
at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:315)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at simpleselect.main(Compiled Code)
Unable to load JdbcOdbc library
Unable to allocate environment
getConnection: no suitable driver
java.sql.SQLException: No suitable driver
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(Throwable.java:94)
at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:64)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at simpleselect.main(Compiled Code)
SQLException: SQLState(08001)

*** SQLException caught ***

SQLState: 08001
Message: No suitable driver
Vendor: 0

Marc Thompson

unread,
Dec 30, 1999, 3:00:00 AM12/30/99
to
Yong,

I've seen this type of question posted several times. I'm certainly not an
expert, but here are my thoughts.

Java 1.2 provides the java.sql package, which is probably what you should be
using. If you are, then look at the api documentation that shows that the
'Driver' is an Interface, not a Class. In other words, database vendors will
write a JDBC driver for their particular product that implements the
java.sql.Driver interface, which may be a Type4 (pure Java) or an earlier type
driver (JDBC:ODBC).

I'm pretty sure that the same thing applies with the pre-Java2
sun.jdbc.odbc.JdbcOdbcDriver; you can't call it directly.

For example, I use Informix. To load my Informix driver, I have to call the
Informix-provided class like this:

Class.forName("com.informix.jdbc.IfxDriver");

and then register it with the java.sql.DriverManager class.


Read the last part of the error message you're getting;

*** SQLException caught ***

SQLState: 08001
Message: No suitable driver
Vendor: 0

The message seems to support the situation that I've described. Of particular
interest is the null/0 value for the vendor.

I'm a bit of a newbie too, so I could be way off target.

Good luck,
Marc Thompson

Yong Qian

unread,
Dec 31, 1999, 3:00:00 AM12/31/99
to
Marc,

Thank you very much for the help. I will be looking into the driver
specifications that come with Java1.2 after new year's day. All of
servers/databases were shut down now for fear of the Y2K.

Yong

Manfred Rosenboom

unread,
Jan 3, 2000, 3:00:00 AM1/3/00
to
On Thu, 30 Dec 1999 15:42:20 -0500, "Yong QIan"
<qi...@grc.nia.nih.gov> wrote:

>Newbie question.
>I am trying the code under JAVA1.2. The code looks this:
>
> String url = "jdbc:odbc:MOUSESTS";
> String query = "SELECT * FROM emp";
>
> Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
> Connection con = DriverManager.getConnection (
> url, "my-user", "my-passwd");
>
>
>After running on Solaris7, I get the following message. Can anyone help me
>to
>find out what was wrong?

The JDBC-ODBC-Bidge (JdbcOdbcDriver) needs a native DLL, which is only
available for Windows, because ODBC is available on Windows systems
only.

Manfred

0 new messages