Subject Calling a stored procedure without any parameters fails.
Author Stephen J. Thompson
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all,

Anyone know what I have done wrong? I have tried IC1.6 and IC2.0 on a linux
platform.

This class fails. Enclosed is the SQL for the database and also a class that
recreates the failure.


package ibtemp;

import java.sql.*;

/**
* This class does not work with a database as specified
* in the sql code:
*
* CREATE GENERATOR "GEN_PART";
*
* SET TERM ^ ;
* CREATE PROCEDURE "GET_PART_UID"
* RETURNS
* (UID INTEGER)
* AS
* BEGIN
* UID = GEN_ID(get_part, 1);
* END ^
*
* SET TERM ; ^
*
*
* It creates an:
*
* interbase.interclient.SQLException: [interclient][interbase] Dynamic SQL
Error
* parameter mismatch for procedure GET_PART_UID
* at
interbase.interclient.PreparedStatement.remote_PREPARE_STATEMENT(Unknown
Source)
* at interbase.interclient.PreparedStatement.<init>(Unknown Source)
* at interbase.interclient.CallableStatement.<init>(Unknown Source)
* at interbase.interclient.Connection.prepareCall(Unknown Source)
* at ibtemp.Untitled1.<init>(Untitled1.java:12)
* at ibtemp.Untitled1.main(Untitled1.java:20)
*
*/

public class Untitled1 {

public Untitled1() throws Exception {
Class.forName("interbase.interclient.Driver");
Connection dbConnection = DriverManager.getConnection(
"jdbc:interbase://telaxian/opt/database/DFS.gdb", "SYSDBA", "masterkey");

CallableStatement stmt = dbConnection.prepareCall("{call GET_PART_UID}");
ResultSet rs = stmt.executeQuery();

}


public static void main(String[] args) {
try {
Untitled1 untitled11 = new Untitled1();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6gpuzPmm0AnNwb5MRAvlXAJ9wxgIO3St3SFrknTdf9wqfhH1HCQCggKy+
uoGvRCjgpJ+fLlE1hpVL8XA=
=4Qec
-----END PGP SIGNATURE-----