Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Posts: 5899
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Dumb Coder", please check your private messages regarding an important administrative matter.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!