请问怎样用JAVA执行SQL SERVER 2000中的存储过程?
我是这样做的
StringBuffer sql = new StringBuffer( "execute FindDays ' "+daytime+ " ' ");
执行这个SQL语句
public static Vector findDays(Timestamp daytime) throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
Vector resultList = null;
StringBuffer sql = new StringBuffer( "execute FindDays ' "+daytime+ " ' ");
try {
conn = ConnectionHandler.getConnection();
pstmt = conn.prepareStatement(sql.toString());
rs = pstmt.executeQuery();
while(rs.next())
{
Object[] obj=new Object[2];
obj[0]=rs.getInt(1);
obj[1]=rs.getTimestamp(2);
}
} finally {
ConnectionHandler.close(conn, pstmt, rs);
}
return resultList;
}
是不是执行存储过程的方法错了?
执行后得不到值
我传递的参数是有的,检查过了
存储过程也是对的
显示错误是在JSP页面中取值的时候
Vector v=AccessIpHome.findDays(stat.getDayTime());
Enumeration e=v.elements();
[解决办法]
错误信息