on 04-30-2015 10:35 AM
Hi all
I am trying to connect hana using jdbc code
here is my code
Class.forName("com.sap.db.jdbc.Driver");
String url = "jdbc:sap://host:30015/?";
String user = "Mujadid";
String password = "Cloud123";
System.out.println("try to connect to HANA !");
Connection cn = java.sql.DriverManager.getConnection(url, user, password);
System.out.println("Connection to HANA successful!");
ResultSet rs = cn.createStatement().executeQuery("select * from _SYS_STATISTICS.STATISTICS_ALERTS");
rs.next();
System.out.println(rs.getString(1));
I am facing following exception
com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [414]: user is forced to change password: alter password required for user MUJADID
at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:345)
Any suggestion?
Hello,
I believe as per the exception, you are using a HANA DB user with initial password hence it throws an exception. Try to connect to SAP HANA DB using a HANA studio (or) HANA XS URL and change the password.
Now try connecting to the HANA using the new password in JDBC code. Hope it works.
Regards,
Mat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mathan!
now above error is esolved
But i m facing following error when i try to read connections table from live2 schema
com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [259] (at 20): invalid table name: Could not find table/view CONNECTIONS in schema LIVE2
and this table exist in LIVE2 schema
Any suggestion?
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.