• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection problem

 
Manish Kapasiya
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting this exception..


what is the reason of getting this error and how can i resolve it.

 
Manish Kapasiya
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at DataBase.CustData..main(CustData.java)
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you adding the jar file(s) containing the driver to the classpath?
 
Manish Kapasiya
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have resolved the problem....
now i added the required jar files in the ext folder for extension class loader to locate... no need to set User environment variable.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manish Kapasiya wrote:now i added the required jar files in the ext folder for extension class loader to locate... no need to set User environment variable.


You're going to regret that in a while, when you upgrade Java to a new version and find that its ext folder doesn't contain your JDBC driver. Of course by then you will have forgotten that you used the extensions directory trick and you will have to spend some time figuring out what's going on. I'd recommend that you spend a minute learning how to use the classpath and put your JDBC driver there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic