Re: ClassNotFoundException

From: Tjerk Wolterink (tjerk_at_wolterinkwebdesign.com)
Date: 12/07/04


Date: Tue, 07 Dec 2004 22:17:09 +0100


[cut]

When you using database you must have the JDBC Driver for that type of database.
JDBC: Java Database Connectivity.
JDBC Defines an framework/api for java connecting to sql databases.
It has some Interface objets in iut that a specific driver for a specific database must implement.

So you must have a driver for your specific database in your classpath
The driver you want to use is: com.informix.jdbc.IfxDriver

>
> On JDBC dbping tab is written "This Utility assumes that you have a JDBC
> driver installed and a CLASSPATH set before running DBPING"
> a) What do they mean by having a JDBC driver installed? Isn't this driver
> installed when I installed Informix-SDK? If not, how can I get it?

I think, but am not sure, that the driver is in your Informix-SDK
But you must include the .jar or .class that is the driver in your classpath.

> b) Do I have to do something like I did to the ODBC driver (by creating and
> configuring a
> DSN)? Where and how?

dsn? i do not follow you here.

> c) I know CLASSPATH system variable isn't set. Should I set it in my system?
> By what value? By a path within Informix-SDK folders? Should CLASSPATH be
> set anywhere else (e.g. setnet32)?

When you run your application you must bee sure that the com.informix.jdbc.IfxDriver
class is in your classpath, see the documentation of Informix where com.informix.jdbc.IfxDriver resides.

>
> I suspect the problem is in my CLASSPATH system variable, but I don't know
> how to set it. Or, perhaps, the strings I'm using aren't correct.
> Can Anyone help?

You CAN set your classpath system var to include com.informix.jdbc.IfxDriver but it will then only
work on your computer. Better is to set the classpath in your application,
for example if you start your application from a .jar you can include com.informix.jdbc.IfxDriver
by editing the manifest file of the jar.

Else you could create a Start script that sets up the classpath first

>
> Thanks in advance,
> Jorge Cecilio
>
>
>
>
>



Relevant Pages

  • RE: New JDBC 1.2 driver runs slower than JDBC 1.1; my db definitio
    ... If the support incident ends up verifying a slowdown in the new driver, ... New JDBC 1.2 driver runs slower than JDBC 1.1; ... I do think this would happen in general, not just for my database; ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Problem with JDBC MSSQL
    ... >> JDBC from an applet. ... > classes and you can easily use another persistent storage instead of JDBC. ... > JDBC driver talks to the database. ...
    (comp.lang.java.databases)
  • Re: SAP direct JDBC access
    ... > data with JDBC. ... > SQL Server. ... you can use a data source to hide the actual database ... driver used. ...
    (comp.lang.java.programmer)
  • path question
    ... I'm just started off with databases and jdbc. ... I load the driver by: ... copy the com/org directories to some dir and include them in the java ... For the classpath as well, ...
    (comp.lang.java.databases)
  • RE: New JDBC 1.2 driver runs slower than JDBC 1.1; my db definition
    ... I do think this would happen in general, not just for my database; ... [PersonGID] ... While we did not specifically target performance with the v1.2 driver beyond the Adapative Buffering changes, I am surprised that you are seeing slower ... New JDBC 1.2 driver runs slower than JDBC 1.1 driver-- expected?? ...
    (microsoft.public.sqlserver.jdbcdriver)