File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
Author

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

Band Kum
Greenhorn

Joined: May 04, 2010
Posts: 1
Hi,
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
Class.forName("com.ddtek.jdbc.sqlserver.SQLServerDriver");
String url = "jdbc:datadirect:sqlserver://141.128.92.68:3010";
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?
Thanks
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2885
    
  13

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


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
My Home Page -- Twitter Profile -- JavaRanch FAQ -- 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)"
 
Similar Threads
Jboss Migration from 4.0.5 to 4.2.3 (getting context.lookup = NULL)
Calling stored procedures
wrong number or types of arguments in call to 'P_RETRIEVE_OPPTY_ORDER_STATUS'
Using CallableStatement to access an Oracle Proc
How to access Stored Procedure