sun.jdbc.odbc.JdbcOdbcDriver 哪儿错了
新手真是哭了TT程序是importjava.sql.*;publicclassora{publicstaticvoidmain(String[]args){try{Cla...
新手真是哭了T T
程序是
import java.sql.*;
public class ora {
public static void main(String[] args) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("1");
Connection conn = DriverManager.getConnection("jdbc:odbc:myora", "scott", "tiger");
System.out.println("2");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp");
while (rs.next()) {
System.out.println(rs.getString(2));
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
classpath是 C:\Program Files\Java\jdk1.7.0_71\jre\lib;
rt.jar的位置是C:\Program Files\Java\jdk1.7.0_71\jre\lib 展开
程序是
import java.sql.*;
public class ora {
public static void main(String[] args) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("1");
Connection conn = DriverManager.getConnection("jdbc:odbc:myora", "scott", "tiger");
System.out.println("2");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp");
while (rs.next()) {
System.out.println(rs.getString(2));
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
classpath是 C:\Program Files\Java\jdk1.7.0_71\jre\lib;
rt.jar的位置是C:\Program Files\Java\jdk1.7.0_71\jre\lib 展开
2个回答
2014-12-14
展开全部
就是那里出了问题!
追问
我也是惊呆了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询