为什么ResultSet会出错?
为什么ResultSet会出错?
我用:
String strSql="SELECT GETDATE()";
ResultSet rsDate=regBean.executeQuery(strSql);
if(rsDate.next())
{
strDate=rsDate.getDate(1).toString();
strTime=rsDate.getTime(1).toString();//--(1)
strDT=strDate+strTime; //--(2)
}
else
strDate="no";
rsDate.close();
浏览器却提示:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: No data found
而我将(1)(2)句隐去却没有问题了,这是为什么?