cancel
Showing results for 
Search instead for 
Did you mean: 

How to use JDBC destinations in WDJ?

former_member186148
Active Participant
0 Kudos

Hello SDN!

My WebDynpro application should connect to HANA DB via JDBC and read some data. We've made settings according to this  http://help.sap.com/SAPhelp_nw73/helpdata/en/1c/e05bc0c9ca41a783169ce4e18c1bfe/content.htm?frameset=.... But now I'm confused how to get a connection to the DB. If I use the following code:


Class.forName("com.sap.db.jdbc.Driver");

Connection connection = DriverManager.getConnection("jdbc:sap://hanaServer:31015/?autocommit=false");

without user credentials, then I get an error "com.sap.db.jdbc.exceptions.jdbc40.SQLInvalidAuthorizationSpecException: [10]: invalid username or password".

If I use credentials, everything is ok, but in this case URL to DB and user's credentials are hardcoded which is no good. There're destinations in the link mentioned above. How I can use these destinations in my code to get connection?

regards,

Lev

Accepted Solutions (1)

Accepted Solutions (1)

former_member186148
Active Participant
0 Kudos

It seems that the only way to work with JDBC in NW7.31 is using the connection pool as described in this blog

Regards,

Lev

Answers (2)

Answers (2)

Sriram2009
Active Contributor
0 Kudos
former_member186148
Active Participant
0 Kudos

Hi Sriram!

I'm afraid that this note is not suitable for me since this note for SAP BI and I'm talking about SAP NW 7.31 and Web Dynpro applications.

Is it true, that JDBC destinations are not for using in WDJ applications? And the only way to connect to the HANA DB from WDJ app is using the JDBC Connection pool? Please correct me if I'm wrong.

regards,

Lev

former_member186148
Active Participant
0 Kudos

Does anybody know how to work with JDBC in WDJ 7.31?