NO suitable driver:oracle n java

I am using jdk1.6 n oracle 10.2.0.1.0

when i run this code ... OracleConnection.java

import java.sql.*;

public class OracleConnection

{

Connection con;

public OracleConnection()

{

try

{

Class.forName("oracle.jdbc.OracleDriver");

String user = "system";

String pwd = "simha";

con = DriverManager.getConnection("jdbc:orcale:thin:@localhost:1521:vinay",user,pwd);

}catch(Exception e){e.printStackTrace();}

}

public static void main(String args[])

{

new OracleConnection();

}

}

getting error as

java.sql.SQLException: No suitable driver

at java.sql.DriverManager.getConnection(DriverManager.java:545)

at java.sql.DriverManager.getConnection(DriverManager.java:171)

at OracleConnection.<init>(OracleConnection.java:13)

at OracleConnection.main(OracleConnection.java:19)

i had specified the ojdbc14.jar in the classpath also....plz give me the reasons why i am getting this error n what is the solution?

[1073 byte] By [simhavcs@gmail.coma] at [2007-11-27 4:04:14]
# 1
I think, you should use Class.forName( "oracle.jdbc.driver.OracleDriver" )Also, you have a typo in jdbc:orcale:thin.Tobias
tobias.winterhaltera at 2007-7-12 9:09:05 > top of Java-index,Java Essentials,Java Programming...
# 2
still i am getting the same error
simhavcs@gmail.coma at 2007-7-12 9:09:05 > top of Java-index,Java Essentials,Java Programming...
# 3

First, you've got the wrong class name for the Oracle driver.

Secondly, you haven't registered the Oracle driver.

So... two approaches to fix.

Approach 1, register the driver manually

public OracleConnection()

{

try

{

Driver oracleDriver = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver");

DriverManager.registerDriver ( oracleDriver );

String user = "system";

String pwd = "simha";

con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:vinay",user,pwd);

}

catch(Exception e)

{

e.printStackTrace();

}

}

Approach 2, register the driver via command line

Add

-Djdbc.drivers=oracle.jdbc.driver.OracleDriver

to the command line which runs your program.

regards,

Owen

omcgoverna at 2007-7-12 9:09:05 > top of Java-index,Java Essentials,Java Programming...