cancel
Showing results for 
Search instead for 
Did you mean: 

oracle DB connectivity : No suitable driver

ashish_shah
Contributor
0 Kudos

Hi Experts,

I am trying to connect to oracle database through java.

For this i have written the following code.

try

{

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

}

catch (ClassNotFoundException e)

{

// TODO Auto-generated catch block

e.printStackTrace();

}

Connection conn;

//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

try {

conn = DriverManager.getConnection("jdbc:oracle:thin:@155.125.45.243:1522:SEBND801","SDC_APT","abcd");

}

catch (SQLException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

wdComponentAPI.getMessageManager().reportException("Error in connecting to the SDC database",false);

}

I am getting the error : No suitable driver.

Do i need to add any jar files on the server or in my project?

Appriciate your help in this.

Ashish Shah

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Check

add classes12.jar to your project

Regards

Abhijith YS

ashish_shah
Contributor
0 Kudos

Hi Abhijit , Chintan,

Thanks for your respose.

I am using j2sdk1.4.2_11 , when i checked the site : http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html

I could see these three classses for JDK 1.4 , now can you tell me which one do i need to include in my WebDynpro application?

ojdbc14.jar - JDBC classes (1,212,964 bytes)

ojdbc14_g.jar - JDBC classes with debug and trace(1,427,311 bytes)

ocrs12.jar - Additional RowSet support (37,761 bytes)

Also , Do i need to install / deploy or configure anything in my WebApplication server?

Ashish Shah

Former Member
0 Kudos

Hi

You need ojdbc14.jar

Rest is self explanatory.

Regards

Ayyapparaj

ashish_shah
Contributor
0 Kudos

After adding the file ojdbc14.jar

I am still getting the error : No suitable driver as my (SQLException)e1.getLocalizedMessage().

Can you suggest the cause for this?

Ashish Shah

chintan_virani
Active Contributor
0 Kudos

Is this a local project or a DC?...

Former Member
0 Kudos

Hi Ashish,

if you are using Loca web dybpro project for connecting to Oracle,add that jar(Ojdbc14.jar) in the libraries folder of your webdybporo project.you can find the libraries folder in the Web dynpro navigator.

Hope this Helps to u

With Regards

Naidu

ashish_shah
Contributor
0 Kudos

Thanks balu,

My project was a local project and Adding those jars in library folder of the project solved the problem.

Ashish Shah.

ashish_shah
Contributor
0 Kudos

Hi Balu,

Can you share incase of a DC project , where do i need to add these jar files?

Ashish Shah

chintan_virani
Active Contributor
0 Kudos

Ashish,

In case of DC project you will need to create a library project and place the jar file in it. Then you need to add the library project as a used DC in your application DC and it should work fine then.

Following links may help you...

/people/bala.krishnan2/blog/2006/09/25/bid-adieu-to-bots--using-captchas

/people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro

- Chintan

Answers (1)

Answers (1)

chintan_virani
Active Contributor
0 Kudos

Ashish,

Depending on the version of Oracle you are trying t connect you will need to add the Oracle-JDBC jar files. You can check the following link

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html

- Chintan