JSP连接ORACLE问题
try{
Class.forName( "oracle.jdbc.driver.OracleDriver ");
Connection conn=DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:zyc ", "zyc ", "zyc1984 ");
String str= "select * from admin ";
Statement stat=conn.createStatement();
ResultSet rs=stat.executeQuery(str);
while(rs.next()){
out.println(rs.getString(2));
}
}catch(
ClassNotFoundException e){out.print(e);}
为什么我在Class.forName( "oracle.jdbc.driver.OracleDriver ");后面加上out.println(1);就显示不出输出的数据了
相同的语言放到类里面就能读出数据,为什么放到JSP里就不对了
------解决方案--------------------拋出異常了吧