[英]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 尝试连接到系统中配置的时间戳数据库时出现此错误:java.sql.SQLException:加载本机库/丢失方法时出现问题:java.library.path中没有ttJdbc1121
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. 我在构建路径中使用Java 5和附加的ttjdbc5.jar。 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);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.