我的代码是
import java.sql.*;
public class SelectTest{
public static void main(String arr[]) {
try {
class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:myDb","system","oracle");
Statement stmt=con.createStatement();
ResultSet rset=stmt.executeQuery("select * from emp");
while(rset.next()) {
System.out.print(rset.getInt(1)+"\t"+rset.getString(2)+"\t"+
rset.getString(3)+"\t"+rset.getInt(4));
}//while loop
con.close();
}//try
catch(Exception ex) {
System.out.print(ex);
}//catch
}//main
}//class
我将系统环境中oracle DB的类路径设置为
C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;.
我在用户变量中将 jre 的路径设置为
C:\Program Files\Java\jdk1.7.0_17\bin;.;
我不明白为什么我的程序会出错:
Error: this program is not recognised as internal or external command.