当前位置: 技术问答>java相关
jdbc:odbc出错,很简单的啦
来源: 互联网 发布时间:2015-02-01
本文导语: 小弟第一次写jdbc,运行错误如下: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:537) at java.sql.DriverManager.getConnection(DriverManager.java:177) at Select.main(Select.java:28) 原文件是: try { Stri...
小弟第一次写jdbc,运行错误如下:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at Select.main(Select.java:28)
原文件是:
try {
String url = "jdbc:odbc:cd";
Connection con = DriverManager.getConnection(url, "", "");
................
ODBC是配好了的。
请指教!
多谢了!
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at Select.main(Select.java:28)
原文件是:
try {
String url = "jdbc:odbc:cd";
Connection con = DriverManager.getConnection(url, "", "");
................
ODBC是配好了的。
请指教!
多谢了!
|
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url = "jdbc:odbc:cd";
Connection con = DriverManager.getConnection(url, "", "");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url = "jdbc:odbc:cd";
Connection con = DriverManager.getConnection(url, "", "");