简体   繁体   中英

java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc1121 in java.library.path

I am getting this error while trying to connect to timesten DB configured in my system: java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc1121 in java.library.path

Here is my code:

    try {
        Class.forName("com.timesten.jdbc.TimesTenDriver");
        conn = DriverManager
                .getConnection("jdbc:timesten:direct:dsn=TT_Alias");
        System.out.println(conn);
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (SQLException e) {
        e.printStackTrace();
    }
    finally {
        try {
            if(conn != null) {
                conn.close();
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

I am using java 5 & attached ttjdbc5.jar in the build path. can someone help please?

ttJdbcCS1122.dll is in bin folder of TimesTen home please copy that to lib folder, now start running you program it will work if rest of configuration is correct.



// /JDBC Driver
static final String JDBC_DRIVER = “com.timesten.jdbc.TimesTenDriver”;
static final String DB_URL = “jdbc:timesten:client:TTC_Server=serverIp;TTC_Server_DSN=DSN;TCP_PORT=PortNo”;

// DB Credential
static final String username = “***”;
static final String password = “****”;

System.out.println(“Registering database …”);
Class.forName(JDBC_DRIVER);

//Connecting to db
System.out.println(“Connecting to database …”);
conn = DriverManager.getConnection(DB_URL, username, password);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM