try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc
dbc:testDB";
Connection con=DriverManager.getConnection(url,"","");
Statement statement=con.createStatement();
String query="select * from testTable";
ResultSet result=statement.executeQuery(query);
while(result.next()){
out.println(result.getString(1));
}}catch(Exception ex){
System.out.println(ex);
}
}
细心一点,先找出笔误,还有{}是不是成对~~~