Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Calling Oracle function from Java problem
Here is my code colling a function from Oracle 8.0.3 package. The function
returns a cursor type. It compiles OK, but at runtime fails with
error 'java.sql.SQLException: Parameter Type Conflict' at the line with
<****************************
String driver_class = "oracle.jdbc.driver.OracleDriver"; String connect_string = "jdbc:oracle:thin:@192.168.1.19:1521:netc"; String query = "begin :1 := pg_search_catalog.search_catalog(:2); end;";
Connection conn; Class.forName(driver_class); DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ()); conn= DriverManager.getConnection(connect_string, "scott", "tiger"); CallableStatement cstmt = conn.prepareCall(query); cstmt.setString(1, "wire"); cstmt.registerOutParameter(1,OracleTypes.CURSOR);
<****************************
cstmt.execute(); .......
Here is type defs from Oracle package:
TYPE GeneralSearchReturnType IS RECORD ( item_no CHAR(9));
TYPE GeneralSearchCurTyp IS REF CURSOR RETURN GeneralSearchReturnType;
FUNCTION search_catalog(search_str VARCHAR2 ) RETURN GeneralSearchCurTyp;
Why is there a type mismatch. Thanx
Leonid
leonid_at_russiantreasure.com
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Apr 30 1999 - 15:56:01 CDT