• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

JDBC/ODBC classnot found exception

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add the IDS driver to your CLASSPATH.
 
keshav reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I included CLASSPATH variable too
C:\Program Files\classes\jdk14drv.jar. This is also not helped me..
 
sathish kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ]
 
keshav reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic