我得到一個異常沒有合適的驅動程序:值java.sql.SQLException:發現com.timesten.jdbc.TimesTenDriver
java.sql.SQLException: No suitable driver found for com.timesten.jdbc.TimesTenDriver while trying to connect to Timesten DB installed in my system.
的代碼如下:
Connection conn = null;
try {
Class.forName("com.timesten.jdbc.TimesTenDriver");
conn = DriverManager
.getConnection("com.timesten.jdbc.TimesTenDriver");
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();
}
}
我使用Java 5 &已附加ttjdbc5.jar在eclipse的構建路徑中。
有人可以幫忙嗎?
所有JDBC URL必須(通過說明書)用'JDBC前綴::' –
感謝@MarkRotteveel編輯的交 – sanbhat