It's not a secret anymore!*
The moose likes JDBC and the fly likes DataDirect Driver : Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"" Watch "DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"" New topic

DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"

Band Kum

Joined: May 04, 2010
Posts: 1
Please help me out, I am trying to use DataDirect Driver and calling one stored procedure in SQL Server 2005. Contantly i am getting error on line "callableStatement.registerOutParameter(1, Types.INTEGER);"

Below is the code snnipette
String url = "jdbc:datadirect:sqlserver://";
Properties connInfo = new Properties();
connInfo.setProperty("user", "user");
connInfo.setProperty("password", "dev");
Connection conn = null;
conn = DriverManager.getConnection(url, connInfo);
CallableStatement callableStatement = null;
callableStatement = conn.prepareCall("{? = call pr_ReturnUserAccesssForAppln(@WinLoginID = ?, @AccessWrite = ?, @AccessRead = ?, @UserId = ?, @Name = ?, @FrostMil = ?)}");
callableStatement.setString("@WinLoginID", "devUser");
callableStatement.setString("@AccessRead", null);
callableStatement.setString("@AccessWrite", null);
callableStatement.registerOutParameter(1, Types.INTEGER); // Getting error at this line
callableStatement.registerOutParameter("@UserId", Types.INTEGER);
callableStatement.registerOutParameter("@Name", Types.VARCHAR);
callableStatement.setInt("@FrostMil", 1);

boolean results = callableStatement.execute();

Please let me know whats going wrong here?
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3014

"Dumb Coder", please check your private messages regarding an important administrative matter.

Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
Consider Paul's rocket mass heater.
subject: DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"
Similar Threads
How to access Stored Procedure
Calling stored procedures
Using CallableStatement to access an Oracle Proc
Jboss Migration from 4.0.5 to 4.2.3 (getting context.lookup = NULL)
wrong number or types of arguments in call to 'P_RETRIEVE_OPPTY_ORDER_STATUS'