Java : JDBC Problem

java , javascript United States
  • 15 years ago

    Hi there all,


    I had this code:

    Code:

    import java.sql.;
    import java.math.
    ;
    import java.io.*;


    public class Dbtest{
           public static void main(String args[])
           {
                   try {


                           DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
                           System.out.println("Driver registered...\n");
                           String url = "jdbcracle:thinitdrnd01:1521:REL4";
                           String scall = "{ ? = call SP_GetCustBrthDtIE( ?, ?, ? )}";
                           Connection conn = DriverManager.getConnection(url, "tux", "tux");
                           System.out.println("Connection established...\n");
                           CallableStatement cs = conn.prepareCall(scall);
                           System.out.println("Stored procedure prepared...\n");


                           cs.registerOutParameter(1, Types.DATE); // BrthDt DATE OUT
                           cs.setString(2, "812"); // CustNo varchar(8) IN
                           cs.setString(3, "nor"); // TDMUserID Varchar(32) IN
                           cs.setString(4, "0");   // TDM
    Version Varchar(32) IN


                           System.out.println("Parameter prepared...\n");
                           System.out.println("Execute: " + cs.execute());
                           Date rtn = cs.getDate(1);
                           System.out.println("Got from stored procedure: " + rtn);
                           conn.close();
                   } catch (SQLException e) {
                           System.out.println("Error: " + e.getMessage());
                   }


           }
    }



    but eventually i got this error message

    Quote:

    Driver registered...


    Connection established...


    Stored procedure prepared...


    Parameter prepared...


    Error: ORA-06550: line 1, column 13:
    PLS-00306: wrong number or types of arguments in call to 'SP_GETCUSTBRTHDTIE'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored



    can anyone show me where i make mistakes?

  • 15 years ago

    A conclusion of closing since the problem has been solved

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Nine people can't make a baby in a month.” - Fred Brooks