Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

ojdbc netbeans error :No suitable driver found, jar already added  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I am using Netbeans 8.2
Below is the code that I am using for a test program:


I have added ojdbc7 jar using project > properties > libraries > add jar/folder option

If I am executing my DAO class code using main method, It is able to connect to DB.
but when triggered by jsp > servlet > dao. It leads to below error:


Mar 03, 2018 12:47:22 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/SimpleProject] has started
Mar 03, 2018 12:47:22 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 03, 2018 12:47:22 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/SimpleProject] is completed
User Name:m
Password :n
DEBUG   2018-03-03 12:47:30,298 [http-apr-9001-exec-65] dao.UserLoginDao  - Query executed :Insert into test1(name,id) values(?,?)
ERROR   2018-03-03 12:47:30,298 [http-apr-9001-exec-65] dao.UserLoginDao  - Error due to :java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:xe
Log4J configuration file :E:\tomcat\bin\log4j.properties
DEBUG   2018-03-03 12:47:30,314 [http-apr-9001-exec-65] dao.UserLoginDao  - Created user:0
 
kishor Das
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried above code on eclipse as well. But faced same issue.
On registering DriverManager explicitly the issue was resolved:


Can someone tell me why that was required when driver registration was supposed to be done automatically?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!