jdbc调用存储过程的出现的错误
ALTERPROCEDURE[dbo].[sp_get_goods_by_id]@idBIGINTASBEGIN--SETNOCOUNTONaddedtoprevente...
ALTER PROCEDURE [dbo].[sp_get_goods_by_id]
@id BIGINT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM dbo.goods WHERE uid=@id
END
这样的存储过程怎么调用conn=ConnDB.GetConn();
cs=conn.prepareCall("call sp_get_goods_by_id(?)");
cs.setString(1, uid);;
rs=cs.getResultSet();
while(rs.next()) {
gbBean.setUid(rs.getLong(1));
gbBean.setGoodsName(rs.getString(2));
gbBean.setGoodsInfo(rs.getString(3));
gbBean.setGoodsPrice(rs.getFloat(4));
gbBean.setGoodsNum(rs.getInt(5));
gbBean.setPublisher(rs.getString(6));
gbBean.setPhoto(rs.getString(7));
gbBean.setType(rs.getString(8));
}
这样调用怎么出错了呢 展开
@id BIGINT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM dbo.goods WHERE uid=@id
END
这样的存储过程怎么调用conn=ConnDB.GetConn();
cs=conn.prepareCall("call sp_get_goods_by_id(?)");
cs.setString(1, uid);;
rs=cs.getResultSet();
while(rs.next()) {
gbBean.setUid(rs.getLong(1));
gbBean.setGoodsName(rs.getString(2));
gbBean.setGoodsInfo(rs.getString(3));
gbBean.setGoodsPrice(rs.getFloat(4));
gbBean.setGoodsNum(rs.getInt(5));
gbBean.setPublisher(rs.getString(6));
gbBean.setPhoto(rs.getString(7));
gbBean.setType(rs.getString(8));
}
这样调用怎么出错了呢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询