aspose file tools*
The moose likes JDBC and the fly likes JDBC/ODBC classnot found exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC/ODBC classnot found exception" Watch "JDBC/ODBC classnot found exception" New topic
Author

JDBC/ODBC classnot found exception

keshav reddy
Greenhorn

Joined: May 11, 2007
Posts: 13
This is the program:
-------------------------------------------
import java.sql.*;

public class DbConnetIds
{
public static void main (String [] rags)throws Exception
{
Class.forName("ids.sql.IDSDriver");

Connection con = DriverManager.getConnection("jdbc:ids://localhost:12/conn?dsn='oracle_odbc'","bstest02/pin2","pin2");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT aac_package FROM account_t WHERE aac_promo_code LIKE 'voip_slp_transitions_09%'");

System.out.print("rs.getInt(1)");
}

}
----------------------------------
I am getting following error during run time:
Exception in thread "main" java.lang.ClassNotFoundException: ids.sql.IDSDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at DbConnetIds.main(DbConnetIds.java:7)

-------------------------------------------------
Note : I installed IDS server on my my machine,updated the sytem PATH variable.
I am getting similar error with type1 driver.
sathish kumar
Ranch Hand

Joined: Feb 14, 2007
Posts: 47
Add the IDS driver to your CLASSPATH.
keshav reddy
Greenhorn

Joined: May 11, 2007
Posts: 13
Thanks Sathish for quick response..
Ids is installed in my machine under C:\Program Files\classes\ids. I included this path in system PATH variable. but, still I am getting same error.
keshav reddy
Greenhorn

Joined: May 11, 2007
Posts: 13
I included CLASSPATH variable too
C:\Program Files\classes\jdk14drv.jar. This is also not helped me..
sathish kumar
Ranch Hand

Joined: Feb 14, 2007
Posts: 47
Type echo %CLASSPATH%, in dos window. That will give you confirmation if the driver was added in the path. I still doubt if it is added properly to your classpath.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

C:\Program Files\classes\jdk14drv.jar
Put your driver in a dir without spaces, put that in your CLASSPATH, and try again:

example: c:\libraries\classes\jdk14drv.jar

(aside: you don't have to add the location of jar files to your PATH)
Regards, Jan
[ May 12, 2007: Message edited by: Jan Cumps ]

OCUP UML fundamental and ITIL foundation
youtube channel
keshav reddy
Greenhorn

Joined: May 11, 2007
Posts: 13
Hi Sathish,
The class path also updated properly.
echo %CLASSPATH%
C:\Program Files\classes\jdk14drv.jar.

I think there may be problem with my jdbc-odbc driver(used by type 3 driver).
Can you guide me how to map type1 driver to database name.
sathish kumar
Ranch Hand

Joined: Feb 14, 2007
Posts: 47
For type1 driver, you might need bit of client configuration in your machine. You will have to set a ODBC bridge connection, that will have cross comp. issues when you move it to other platforms.

http://www.javaworld.com/javaworld/jw-07-2000/jw-0707-jdbc.html is an excellent link.
keshav reddy
Greenhorn

Joined: May 11, 2007
Posts: 13
I got the solution for my problem.
Now I am using jdk1.5 and I came to know that IDS (type 3)willn't work on JDK1.5. It will work on JDK1.4

Thanks again for all your responses.
 
 
subject: JDBC/ODBC classnot found exception