- 论坛徽章:
- 0
|
<%@ include file="/base/base.jsp" %>;
sql = "update bgt set a3=?,a4=?,a5=?,a6=? where id =?";
try{
pstmt=conn.prepareStatement(sql);
//设置值
pstmt.setString(1,a3);
pstmt.setString(2,a4);
pstmt.setString(3,a5);
pstmt.setString(4,a6);
pstmt.setString(5,idStr);
//执行
int rows = pstmt.executeUpdate();
conn.setAutoCommit(true);
}catch (Exception e){
out.println(e);
}finally{
try{
if(pstmt!=null)pstmt.close();
}catch(Exception e){
out.print(e);
}
}
这是别人写的代码,我有点不懂,这个conn的来源,它来自哪儿,页面中没有定义它,只见哪来用,且页面中没有一个javabean,怎么可以这样用它呢?可不可以关闭它,关闭了它对整个程序有什么影响?(环境weblogic6.1) |
|