cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting Wed Dynpro application to a SQL Server Table Using EJB

former_member292696
Discoverer
0 Kudos

Hi,

I am trying to create a small web dynpro application that connects to SQL Server database using EJB’s. The connection to the SQL Server is though a JDBC connection that has been setup using SAP's SQL Server JDBC Driver. On the EJB side I am using a session, entity and command bean to access the persistent data.

Below are some questions I have about this project that I hope can be answered:

1. Should the SQL Engine for the DataSource be set to Open SQL or Native SQL? The enterprise application project does not deploy when the SQL Engine type is set to Open SQL.

2. Can entity beans be used to access persistent data that is not stored in the Java dictionary?

Thanks,

Nick

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Nicholas,

Regarding your first question.

Today I try to develop WebDynpro application with direct JDBC connection. I've found that Open SQL provides very limited subset of JDBC functionality (welcome back to JDBC 1.x

So I've created separate driver / data-source via Visual Administrator, that uses <a href="http://jtds.sf.net">jTDS</a> JDBC driver. For this type of driver I have to specify "Vendor SQL" option, while 2 first options make my code fails even in simplest cases.

On other hand, it would be strange if <b>CMP</b> entity beans created with SAP NetWeaver cannot work with SAP WebAS... Or you are using bean-managed persistence?

VS

former_member292696
Discoverer
0 Kudos

I am trying to use a CMP bean to access the data source that points to my SQL database. Do CMP entity beans support this? Or do I have to use BMP.

Former Member
0 Kudos

can you please tell me. How did you defined the datasource name while connecting to SQL datasource from EJB.

We are developing a project in which we have developed DTO and DAO classes in a stateless session bean.We have also defined the resouce-ref in the bean.As per the documentation, we have also created SQL datasource in Visual administrator. While we define, alias in Enterprise Application related to EJB, it takes the default datasource "${sap.com.datasources.default} defined in the SDM, which is wrong as we need to connect to SQL datasource.So we have added the SQL datasource in META-INF folder as data-source.xml file in dtd format.The documentation says that it will connect to the server at the run time, but while i successfully deploy the application project and accesses it in webdynpro, it starts showing nullpointerException because it can not fetch data from sql server, however there is data in base table and i am using the vendor SQL in datasource configuration.

if you come across some solution, kindly contribute.