Quantcast
Channel: SCN : All Content - SAP NetWeaver Application Server
Viewing all articles
Browse latest Browse all 2997

How to use JDBC destinations in WDJ?

$
0
0

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=/en/e5/e971faafee44ff9e22eae8cfbf920f/frameset.htm&current_toc=/en/e5/e971faafee44ff9e22eae8cfbf920f/plain.htm&node_id=23. 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


Viewing all articles
Browse latest Browse all 2997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>