Invalid parameter binding
From: Earl Hokens (earl.hokensREMOVETHIS_at_chi.frb.org)
Date: 11/16/04
- Previous message: Chris Smith: "Re: p0,p1,p2,p3"
- Next in thread: Bjorn Abelli: "Re: Invalid parameter binding"
- Reply: Bjorn Abelli: "Re: Invalid parameter binding"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 15 Nov 2004 17:58:42 -0600
I am having a problem with calling a stored procedure. I have
replicated the problem with multiple JDBC drivers so it doesn't seem to
be driver related. The stored procedure works when I execute in SQL
Enterprise Manager so it isn't the SQL Manager. The code hasn't changed
and it was working at one time so I need help!
I am calling a simple stored procedure that either inserts or updates a
record into a single table and returns the ID for the record. The
stored procedure definition is as follows:
CREATE PROCEDURE dbo.updateDistrictFiles
@brochureId int,
@districtId int,
@contactTypeId int,
@fileDesc varchar(50),
@filePath varchar(100),
@brochureIdOut int OUTPUT
....
The java code invoking the SP is as follows:
CallableStatement c = connection. prepareCall("? = call
updateDistrictFiles(?, ?, ?, ?, ?, ?)";
int index = 1;
cstmt.setInt(index++, getBrochureId());
cstmt.setInt(index++, getDistrictId());
cstmt.setInt(index++, getContactTypeId());
cstmt.setString(index++, getBrochureDescription());
cstmt.setString(index++, getBrochureLocation());
cstmt.registerOutParameter(index, Types.NUMERIC); // tried INTEGER too
recordCount = cstmt.executeUpdate();
newBrochureId = cstmt.getInt(index);
The "executeUpdate" throws the Java Exception with the message:
[Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).
Partial stack trace below.
Any help would be GREATLY appreciated!
TIA
Earl
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Invalid parameter binding(s).
[11/15/04 17:55:53:066 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
[11/15/04 17:55:53:066 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
[11/15/04 17:55:53:066 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BasePreparedStatement.validateParameters(Unknown
Source)
[11/15/04 17:55:53:066 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BasePreparedStatement.validateParameters(Unknown
Source)
[11/15/04 17:55:53:086 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BasePreparedStatement.preImplExecute(Unknown Source)
[11/15/04 17:55:53:086 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
[11/15/04 17:55:53:086 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
[11/15/04 17:55:53:086 CST] 30e29198 SystemErr R at
com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
[11/15/04 17:55:53:096 CST] 30e29198 SystemErr R at
com.microsoft.jdbcx.base.BasePreparedStatementWrapper.executeUpdate(Unknown
Source)
[11/15/04 17:55:53:096 CST] 30e29198 SystemErr R at
com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:555)
[11/15/04 17:55:53:096 CST] 30e29198 SystemErr R at
org.frb.chi.electronic.Brochure.update(Brochure.java:494)
- Previous message: Chris Smith: "Re: p0,p1,p2,p3"
- Next in thread: Bjorn Abelli: "Re: Invalid parameter binding"
- Reply: Bjorn Abelli: "Re: Invalid parameter binding"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|