该函数在被调用的时候第一次能正常执行循环,当执行第二遍的时候就跳出循环体了,不执行while里的那段语句了。
Statement stmt = this.myConnection.createStatement();
String sql = "select subject,mailfrom,mailto,content from spool_mail where id='"+ mailid +"'";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next())
{

String subject = rs.getString("subject");
String mailfrom = rs.getString("mailfrom");
String mailto = rs.getString("mailto");
String content = rs.getString("content");  }
this.myConnection.commit();
rs.close();
rs = null;
stmt.close();
stmt = null;  this.myConnection在另外一个函数里面已经连接过了