cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC error

Former Member
0 Kudos

hi,

i have developed a webdypro project to insert the values in the database.im using SQL server as the backend. im getting an runtime error as noclassdefinition found error.

i have imported the 3 jar files in my application( msbase,msutil,mssql) but still getting the same error.

could u plz help me.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

As u said i have put all the 3 jar files in the library forlder. but still the problem is not solved.

Should i put the 3 jar files in the WAS server also? If yes tel me how to put the jar files in the server.

ankur_garg5
Active Contributor
0 Kudos

Hi raji,

Do the following steps:

1)You need to create a database in your MS SQL Server Enterprise Manager. Create tables and a user in this database. I hope you must have done this step.

2)Now you need to install the JDBC drivers (those 3 drivers). For this go through the following doc:

See the post by Ronnie Kohring as well as by Kavita Sardesai.

You will be able to create a datasource by reading this thread.

4)Last step is the code which is used to access the database. This code is also given in the thread above. The code is:

<b>InitialContext initialContext = new InitialContext();

DataSource dataSource = (DataSource)initialContext.lookup("jdbc/MyAlias");

java.sql.Connection connection = dataSource.getConnection();</b>

Now you can use this connection object just like you normally do in any java program.

Also keep this link for your reference:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/jdbc%2bconnection%2bsetup">jdbc Connection Setup - WIKI</a>

I think you would not need my doc now. If you still face any problem, do tell me.

Do reward good points.

Bye

Ankur

Answers (10)

Answers (10)

Former Member
0 Kudos

Hi Ankur,

My issue is solved.

thanks for ur detailed explanation.

regards,

raji

Former Member
0 Kudos

hi Ankur,

Thanks for ur explanation.

Im following those steps.

vil get back to u if i face any problem.

raji

Former Member
0 Kudos

hi Ankur,

this is my id..

rajiamee2003@gmail.com

thanks,

raji

ankur_garg5
Active Contributor
0 Kudos

Hi raji,

I have already explained all the required steps in my last post. Have you tried them out? If not, then you can try these steps, and let me know if you face any problem. What i would have sent you is not much different from what i have explained.

Bye

Ankur

Do reward points for helpful as well as solved answers!!

ankur_garg5
Active Contributor
0 Kudos

Hi raji,

First of all, you don't need to put those three jar files in any library folder. They have to be put in your WAS server.

Accessing the SQL Server database using java code from NWDS has a proper step by step way.

Give me your email address, i will send you a doc to do this.

Bye

Ankur

Former Member
0 Kudos

Hi Ankur Garg,

Could you please send my this doc ?

I have the same problem.

My email is: thubtat@yahoo.com

Thanks in advance.

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

for adding references on server,

goto visual admin

cluster->server 0 ->service->JDBC Connector(Double click)->click on driver(On right side) here create new DBdrivers and add references of your 3 jar files

hope it helps

regards

Former Member
0 Kudos

Hai,

If you are using DC then add libraries as mentioned in this blog

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

other wise -->

create a library project ad jars to library deploy it and then give the library refernce to your project.

regards,

Naga

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

set mysqlserver.jar in your classpath before running application

hope it helps

regards

Former Member
0 Kudos

Hai,

Swith to navigate view--> paste the libraries in lib folder .

Switch to webdynpro view -> righ click on project>java build path>add jars>expand ur project select jars from lib folder-->

deploy and run it

regards,

Naga

former_member189631
Active Contributor
0 Kudos

Hi Raji,

Please Visit These Links,

Regards,

Ramganesan K.

Former Member
0 Kudos

Hi Raji,

Where you are getting this error ? Post the complete stack trace.

Regards,Anilkumar

Former Member
0 Kudos

Hi Anil,

this is error im getting during runtime.

in my application im using webservice as the model.

#1.5#000FFE22DD5100580000004200000F6000041083137817ED#1175591061420#System.out#sap.com/DBPrg#System.out#Administrator#65####4fa833d0e1c211dbbba3000ffe22dd51#SAPEngine_Application_Thread[impl:3]_14##0#0#Info##Plain###

An exception has occured java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

Found in negative cache