I have a stored function which takes two string parameter and return a boolean value (true/false). Now using jdbc how do i get this boolean value. Below is my code.
//Man begin - added for checking the obselete property of TPHShape System.out.println("Before calling procedure"); // conn.setAutoCommit(false); CallableStatement callstmt = conn.prepareCall("{? = call IS_TPH_OBSOLETE(?,?)}"); System.out.println("procedure called with conn "+conn+" and callstmt "+callstmt); callstmt.registerOutParameter(1,Types.BIT); System.out.println("Checking bit"); callstmt.setString( 2, "ABCD1" ); callstmt.setString( 3, "ENG" ); System.out.println(" called ..."); callstmt.execute() System.out.println("********* In my code value received is ***"); boolean bh = callstmt.getBoolean(1); System.out.println("********* In my code value received is ***"); }catch(Exception er){ System.out.println("Error here only"); er.printStackTrace(); }
} }
its giveing error at "callstmt.execute()" Stating java.sql.SQLException: ORA-06550: line 1, column 13: PLS-00382: expression is of wrong type ORA-06550: line 1, column 7: PL/SQL: Statement ignored
int oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()
void mypackage4.hi.main(java.lang.String[]) Please help its very urgent [ May 13, 2004: Message edited by: Bear Bibeault ]
SJ Adnams
Ranch Hand
Joined: Sep 28, 2001
Posts: 925
posted
0
maybe post the source of the pl/sql function.
Marshall B Thompson
Ranch Hand
Joined: Apr 11, 2002
Posts: 42
posted
0
From the Oracle9i JDBC Developer's Guide and Reference: "the JDBC drivers do not support the passing of BOOLEAN parameters to PL/SQL stored procedures." It is talking about passing to a stored procedure, and you are returning a BOOLEAN from your stored procedure, however; maybe the BOOLEAN is the issue.
Marshall B Thompson
Ranch Hand
Joined: Apr 11, 2002
Posts: 42
posted
0
Funny how things tie together sometimes. I just ran across some doc that says that return values of BOOLEAN from PL/SQL are not supported by JDBC>