This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Invalid parameter binding(s). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Invalid parameter binding(s)." Watch "Invalid parameter binding(s)." New topic

Invalid parameter binding(s).

Ameya Thakur
Ranch Hand

Joined: Feb 04, 2004
Posts: 43
Hi !!!
I am wrting a small store Proc for inserting an value and fetching the Id for the value inserted.

i.e I have Id as an identity column (auto incremented) so i wanted to know the ID for which i am doing the insert operation.

My Store Proc goes like this

CREATE PROCEDURE dbo.spInsertStackTrace
@StackTraceLog as varchar (4000),
@StackTest as varchar (50),
@StackTraceId as int output
Insert Into StackTrace(StackTraceLog,StackTest)
Select @StackTraceId = MAX(StackTraceId) from StackTrace



Persistor myPersistor = PersistorFactory.createPersistor("ccmaster");
CallableStatement cstmt = null;
cstmt = myPersistor.prepareCall("{call spInsertStackTrace(?,?,?)}");
int stackTraceId = cstmt.getInt(3);
System.err.println("Stack Trace Id"+stackTraceId);

with the above code i am getting the following error..

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).

It looks pretty simple i am just not able to figure how to register the out would some one help me and update me that would be very very great.

Thanks a lot
I agree. Here's the link:
subject: Invalid parameter binding(s).
It's not a secret anymore!