Home » Developer & Programmer » JDeveloper, Java & XML » how can i pass the boolean data type as input parameter from java to oracle
how can i pass the boolean data type as input parameter from java to oracle [message #91848] Fri, 18 April 2003 12:33 Go to next message
zbcong
Messages: 3
Registered: December 2002
Junior Member
hello
i want to call a oracle function(oracle817) from my java application,the function receive two parameter (string and boolean) and return a cursor.my code as:

DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.200:1521:oral", "ciqfee", "ciqfeepwd");
String query = "begin :1 := test_func(:2,:3); end;";
CallableStatement cstmt = conn.prepareCall(query);
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
cstmt.setString(2, "3703000032");
cstmt.setBoolean(3, true);
cstmt.execute();


when i execute it,it throw following exception:

java.sql.SQLException: ORA-06550: ?#131;§?#130;¬?#130;¬ 1 ?#131;¨?#130;¡?#130;?#140;, ?#131;§?#130;¬?#130;¬ 13 ?#131;¥?#130;?#136;?#130;?#151;?#131;¯?#130;¼?#130;?#154;
PLS-00306: ?#131;¨?#130;°?#130;?#131;?#131;§?#130;?#148;?#130;¨ 'TEST_FUNC' ?#131;¦?#130;?#151;?#130;¶?#131;¥?#130;?#130;?#130;?#131;¦?#130;?#149;?#130;°?#131;¦?#130;?#149;?#130;°?#131;©?#130;?#135;?#130;?#131;¦?#130;?#136;?#130;?#150;?#131;§?#130;±?#130;»?#131;¥?#130;?#158;?#130;?#139;?#131;©?#130;?#148;?#130;?#153;?#131;¨?#130;¯?#130;¯
ORA-06550: ?#131;§?#130;¬?#130;¬ 1 ?#131;¨?#130;¡?#130;?#140;, ?#131;§?#130;¬?#130;¬ 7 ?#131;¥?#130;?#136;?#130;?#151;?#131;¯?#130;¼?#130;?#154;
PL/SQL: Statement ignored
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
at test.entDbEJBTestClient1.main(entDbEJBTestClient1.java:264)



it is in chinese,means "parameter amount or type error",if i modify my program and the function,use the string as input param only,it works well,so i wonder how i can pass the boolean type param from java app to oracle function?
thanks very much!
Re: how can i pass the boolean data type as input parameter from java to oracle [message #92537 is a reply to message #91848] Mon, 06 September 2004 04:16 Go to previous message
atakal
Messages: 1
Registered: September 2004
Junior Member
I think u cant

public void setBoolean(String parameterName,
boolean x)
throws SQLExceptionSets the designated parameter to the given Java boolean value. The driver converts this to an ***** SQL BIT ****** value when it sends it to the database.
Previous Topic: Oracle specific types
Next Topic: StyleReport v5.1, J2EE, Oracle 8.1.5
Goto Forum:
  


Current Time: Tue Nov 26 01:08:18 CST 2024