jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes Making Connection with database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Making Connection with database" Watch "Making Connection with database" New topic

Making Connection with database

yunuss khan

Joined: Apr 22, 2006
Posts: 17
Hi All,

i m getting below error when i m trying to make conncetion in jsp.

Error occurred java.lang.ClassNotFoundException: jdbc.odbc.JdbcOdbcDriver Error occurred java.sql.SQLException: No suitable driver Error occurred java.lang.NullPointerException

my code is :

Connection conn = null;
ResultSet result = null;
Statement stmt = null;

Class c = Class.forName("jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc dbc:master","","");
stmt = conn.createStatement();
result = stmt.executeQuery("SELECT * FROM Employees");

i m using sql 2000.

pls help.

thanks in advance.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19738

The name of the class is "sun.jdbc.odbc.JdbcOdbcDriver", is it not?
yunuss khan

Joined: Apr 22, 2006
Posts: 17
Thanks Paul...
I agree. Here's the link: http://aspose.com/file-tools
subject: Making Connection with database
It's not a secret anymore!