0

I have an application that connect to mxsql(HP NON STOP DB) using ODBC DRIVER. Below is the code :

 String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String dbUrl = "jdbc:odbc:Smartvista";
    String dbUname = "*****";
    String dbPwd = "******";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(dbUrl, dbUname, dbPwd);
    String getQuery = "some query here";
    System.out.println(getQuery);
    Statement stmt = conn.createStatement();

the code was working fine some time ago but stop working recently throwing below error

java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

I suspect the error is related with java version. Some post has suggest using ucanacess , however i am unable to implement same.

Please advise anyone

0 Answers0