Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

Band Kum
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?
Devaka Cooray
Posts: 4761
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic