我已经配置了数据源 名称为 new 也在数据库中建立了一张表,名字为TABLE1,程序如下,为什么没有TABLE1对象名无效呢?
import java.sql.*;
public class dataBase{
public static void main(String args[]){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(Exception e){}
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
try{
con=DriverManager.getConnection("jdbc:odbc:new","sa","442352");
stmt=con.createStatement();
rs=stmt.executeQuery("select * from TABLE1");
while (rs.next())
{
System.out.print(rs.getString("number")+"<br>");
System.out.print(rs.getString("name")+"<br>");
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
}
[此贴子已经被作者于2007-11-9 19:46:18编辑过]