Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> calling oracle (8i) stored procedures from Java

calling oracle (8i) stored procedures from Java

From: Roy Ambrose <roy_at_ambroser.freeserve.co.uk>
Date: Tue, 10 Aug 1999 14:34:31 +0100
Message-ID: <7op9g5$2a5$1@news7.svr.pol.co.uk>


I have the following problem:

I have created a custom java class (financity.storage.User - which implements SQLData) and am trying to pass an instance of this class to a stored procedure as follows:

    public static void saveUser( OracleConnection conn, financity.storage.User usr )

        throws SQLException
    {

        CallableStatement cstmt = conn.prepareCall( "{call save_user(?)}" );
        cstmt.setObject( 1, usr );
        cstmt.executeUpdate();

    }

I have mapped the class financity.storage.User to an oracle type as required, but at runtime I get the following exception:

java.sql.SQLException: Invalid column type: setObject

        at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:422)
        at

oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:1296)

        at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:1397)

        at
financity.jdbc.DatabaseInterface.saveUser(DatabaseInterface.java:63)

        at financity.jdbc.UserSession.createNewUser(UserSession.java:136)
        at testHarness.main(testHarness.java:21)

hmmmm .... not too sure what is going on here !?!? Thanks in advance. Received on Tue Aug 10 1999 - 08:34:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US