我遇到了一个例外:
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并在 Eclipse 的构建路径中附加了ttjdbc5.jar。
有人可以帮忙吗?