This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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).
Similar Threads
Retrieving the output parameter from the CallableStatement
what is the equivalent data type for Oracle Cursor.
Calling COBOL stored proc from Java Servlet
How to search record on (firstname+lastname) or (lastname+firstname)? please help me
Are there any constraints on length of String?