cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting to Oracle Database

Former Member
0 Kudos

HI All,

In my webdynpro application, i need to insert some values into the Oracle Database through webdynpro Java. When i run my application, it throws an Exception:

"Errorjava.sql.SQLException: No suitable driver "

try

{

conn =DriverManager.getConnection ("jdbc:oracle:thin:@<servername>:<portnumber>:DB","uname", "pwd");

Statement stmt=conn.createStatement();

stmt.executeUpdate ("insert into VEHICLE "

+ "(NAME, PRICE, CURRENCY)"

+ "values ('Audi80', 25000, 'EUR')");

}

finally

{

stmt.close();

}

I have imported the class12 jar. Is there anything else to be done. Why is it throwing me that Exception? How can i rectify that Error? Can anyone please help me on that?

Regards,

Divya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Divya

According to your post , you have already imported classes12.jar into your project. but there are chances that it might not be available at runtime.

For your information...

There are two ways in adding the external JAR files in WebDynpro

1) RightClick on the project - > properties-> Java Build Path - >Libraries ->Add External JAR Files

By doing this , your jar will be available only on the local machine. if the path got changed or file got deleted , you will get errors.so to avoid that

2) Goto Navigation Tab - > navigate through lib directory and paster your .JAR file there

By doing this your jar file will be deployed on to the sever ,so it will be available always on the server

Best Regards

Chaitanya.A

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear Divya,

You need to add the .jar file of the database driver to the project.

Right click on project root node and select properties.

Select Java Build Path and then switch to libraries tab.

Click on Add External Jar to add your jar file.

If you don't have the driver you will first have to download it.

Regards,

Mayuresh

Former Member
0 Kudos

Hi,

Please check this blog

Regards,

ganga

junwu
Active Contributor
0 Kudos

Hi Divya&#65292;

you have to make sure that driver is available in runtime.

where did you put the driver?

you can put it in lib directory of your DC.

John