cancel
Showing results for 
Search instead for 
Did you mean: 

suggesitions required for JDBC in Web Dynpro

konchada_saikrishna
Active Participant
0 Kudos

Hi SDN,

I am working on Web Dynpro project, till now we are working with SAP R/3 as backend database.

Now we need to store the data in sql server along with SAP R/3 with the same project.

Our people suggested to use EJBs.

I need to know how to create EJB for web dynpro if any specification.

how to deploy it in sneak previw

How to call that EJB in the application.

I have sneak preview in sys1,

Sql server in sys 5,

SAP R/3 in sys2,

NWDS in sys-j2e.

please suggest any PDF exists.

help me in this regard.

Thanks in Advance.

Sai.K.K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Sai,

you can create the datasource in two ways

1. using visual admin, goto /<Instance>/server<no>/Services/JDBC Connector/

select runtime tab and then select datasource and create the datasource

and also u can create an alias and use it for ur EJB application

2. creating an datasource alias using develpoer Studio (Enterprise Application Project), this will connect to the default Database installed with engine

Regards

PP

konchada_saikrishna
Active Participant
0 Kudos

Hi Pavan,

I searched the forums with respect to that.

1) I created a J2EE server component-->library named sqljars.

Added external jars to the sqljars properties.

Built library archive.

Deployed it to my server.

2) Created a webdynpro project named sample.

In the view controller init method I had code

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://mid:1433;DatabaseName=WSO","sa","sa");

Added the sqljars project in the javabuild path of sample project.

3) placed the required jars in java lib,

placed the required jars in usr\sap\J2E\JC00\j2ee\admin\lib,

Still getting Classnot found exception : java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

Regards,

Sai.k.k

Former Member
0 Kudos

Hi Sai,

I suggest you to register the driver first in Visual admin ,

then try to use the library by adding the jar into your project classpath.

Regards

PP

siarhei_pisarenka3
Active Contributor
0 Kudos

> Still getting Classnot found exception :

> java.lang.ClassNotFoundException:

> com.microsoft.jdbc.sqlserver.SQLServerDriver

The error can be fixed if you use SAP driver for SQL Server:

driver: 'com.sap.nwmss.jdbc.sqlserver.SQLServerDriver'

url: 'jdbc:nwmss:sqlserver://mid:1433;DatabaseName=WSO'

BR

Sergei

konchada_saikrishna
Active Participant
0 Kudos

Hi Siarhei,

I tried using the driver, url specified by you It still gave the same error message .

Regards,

Sai.k.k

Former Member
0 Kudos

Hi Sai,

I feel you have not registered th driver,

go through the following link for registering the driver and for creating datasource alias http://help.sap.com/saphelp_nw04/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/content.htm

Regards,

PP

Answers (3)

Answers (3)

konchada_saikrishna
Active Participant
0 Kudos

I have created a driver in visual admin, later created a data source with this driver.

balaji_bodagala5
Participant
0 Kudos

Hi,

for accessing the sqlserver we need to make sure that data source is created or not if not create the data source in visual administrator,and then come to NWDS,

There are two ways

1)create a J2EE project and create the ejb module from that you can lookup the data source

2)create the webdynpro before that create a command bean,that means simply a bean that will lookup the datasource,write the method that will return the list or vector,iterate the list store in strings that will set to context.

Thanks,

Balaji

konchada_saikrishna
Active Participant
0 Kudos

Hi Balaji,

Exactly I am thinking about do we need to have something in sneakpreview to access SQL server.

Can you please tell me how to create a data source in visual admin what all needed and steps.

also a tutorial or code for the jdbc in ejb with look up.

Thanks & Regards,

Sai.k.k

Former Member
0 Kudos
konchada_saikrishna
Active Participant
0 Kudos

Hi Anil,

Thank you,

I have gone through the tutorial, its very helpful, but it does'nt tell how to use jdbc in the ejb.

And creation of the ejb with JDBC in NWDS.

Regards,

Sai.K.K