一般情况下,最好不要用javabean直接获得resultset
因为这样你怎么对connection控制,connection怎么来关闭
最好是直接获得connection或者statement
<jsp:useBean id="conn" class="gip.common.DbConnection" scope="request"/>
<%
Connection CONN=conn.getCon();
Statement stmt=CONN.createStatement();
String sql="select * from tablename";
ResultSet rs=stmt.executeQuery(sql);
.....%>
因为这样你怎么对connection控制,connection怎么来关闭
最好是直接获得connection或者statement
<jsp:useBean id="conn" class="gip.common.DbConnection" scope="request"/>
<%
Connection CONN=conn.getCon();
Statement stmt=CONN.createStatement();
String sql="select * from tablename";
ResultSet rs=stmt.executeQuery(sql);
.....%>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货