File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 19973

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:
subject: Making Connection with database
It's not a secret anymore!