cancel
Showing results for 
Search instead for 
Did you mean: 

com.sap.db.jdbc.exceptions.JDBCDriverException:user is forced to change password

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

mathanponnucham
Employee
Employee
0 Kudos

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.

Former Member
0 Kudos

Thanks Mathan error is resolved

Former Member
0 Kudos

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?