• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

No suitable driver found for jdbc:oracle:thin:@localhost:1521:CON

 
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My FirstCode in jdbc

error :
Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:CON
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.cls.demo.JdbcDemo.main(JdbcDemo.java:35)

1)what is this thin driver ?

jdbc:oracle:thin:@localhost:1521:CON


what does this say ?
 
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Thin driver is a jdbc library that allows you to connect to an Oracle database without needing Oracle client software.

You can download it from Oracle.

 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why i am keep getting this Exception ?? What's Wrong

Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc: oracle:thin:@localhost:1521:CON
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.cls.demo.JdbcDemo.main(JdbcDemo.java:35)
 
Jan Cumps
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You get this error because you did not make the oracle jdbc thin driver library available when running your program.

Download the Oracle jdbc library.
add it to the classpath when running your program.

This line of code seems odd : Class class1 = ClassLoader.getSystemClassLoader().loadClass("oracle.jdbc.driver.OracleDriver");
Where did you learn to load a driver class that way?

 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jan Cumps wrote:You get this error because you did not make the oracle jdbc thin driver library available when running your program.

Download the Oracle jdbc library.
add it to the classpath when running your program.


I have Added.

Jan Cumps wrote:This line of code seems odd : Class class1 = ClassLoader.getSystemClassLoader().loadClass("oracle.jdbc.driver.OracleDriver");
Where did you learn to load a driver class that way?



No,why so?




 
Jan Cumps
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was expecting to see : Class.forName ("your driver class");
(and with JDBC 4 drivers you can completely skip loading the driver)
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It Worked fine!now!
 
Message for you sir! I think it is a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic