Calling stored procedures in Java is easy. In the example below, storedproc is the name of the procedure and it takes one parameter of type numeric. It also return an int value.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:test1","sa","password");
String sql= "{ call storedproc(?) }";
cst=con.prepareCall(sql);
int i=1;
cst.registerOutParameter(1,Types.NUMERIC,0);
cst.setInt(1,i);
cst.executeUpdate();
i=cst.getInt(1);