Posted on 2011-04-07 12:18
帅子 阅读(1122)
评论(0) 编辑 收藏 所属分类:
j2se技术专区 、
申请加入java团队 、
j2ee技术专区
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Object has been closed.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.validateClosedState(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.validateClosedState(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)
查询代码:
String sql="select * from ws_D_E_C ORDER BY DEP_ID";
cnn=cn.getCon();
smt=cnn.createStatement();
rs=smt.executeQuery(sql);
while(rst.next()){}
出现这个问题的原因是什么,有什么好的解决方法。