The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Executing Stored Procedures

Posted by sudhir.k on July 17, 2000 at 8:20 AM

/*Part of the code where the connections are established, and i am trying to execure a stored procedure.
My stored procedure needs three parameter to be passed. One integer and two string values.
Please look into the code and try fixing the bug .
*/

import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.io.*;
import java.util.*;
import java.lang.*;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:myserver","sa","");
CallableStatement cs= con.prepareCall("{call SaveDept(?,?,?)}");
cs.setInt(1,DeptId);
cs.setString(2,DeptName);
cs.setString(3,DeptDesc);
cs.executeQuery();

Error : Method setInt(int,java.lang.String) not found in interface java.sql.CallableStatement.
cs.setInt(i,DeptId);




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us