aspose file tools
The moose likes JDBC and Relational Databases 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 Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 3360

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

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"