aspose file tools*
The moose likes JDBC 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
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: 18115

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
Similar Threads
Error catching for DataSource
How to connect to mysql database?
connect my MySQl databse
Accessing Connection pool
In JSP + Jdbc web page can "System.out.println()" can be used?