on 08-27-2017 9:33 AM
When i am connecting to my sap hana data base so its throwing below exception but if i am not specifying any Database name then it connecting by default to HEX data base of sap hana.
com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Cannot connect to jdbc:sap://192.168.33.114:39015/ [SAP DBTech JDBC: [2]: general error: SYSTEMDB not connected]
Here is dummy code
<code>import java.sql.Connection;import java.sql.ResultSet;publicclassSapConnection{publicstaticvoid main(String[] args){// TODO Auto-generated method stubtry{Class.forName("com.sap.db.jdbc.Driver");String url ="jdbc:sap://192.168.33.114:39015/?databaseName=abcd";String user ="abc";String password ="xyz";Connection cn = java.sql.DriverManager.getConnection(url, user, password);// ... do whatever with the results ...}catch(Exception e){
e.printStackTrace();}}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.