<p>How to call PL/SQL in JBuilder?</p>
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Edward_Edward
Posted On:   Monday, June 10, 2002 01:13 AM

I have a PL,it like follows: CREATE OR REPLACE PACKAGE BODY LOGIN_FUNCTION AS PROCEDURE verifypl( userName IN CHAR, userPassword IN CHAR, cur_verifypl_data OUT curLogin, exceptionFlag OUT NUMBER ) IS l_sql VARCHAR2(300); BEGIN l_sql := 'Select * from user_info_tbl where user_id = ''' || userName || ''' and password=''' || userPassword || ''''; Dbms_output.put_line('Excute sql: --- ' || l_sql); OPEN cur_verifypl_data FOR l_sql; exceptionFlag:=0; EXCEPTION WHEN OTHERS THEN Dbms_output.put_line('Error Number: ---' || sqlcode); Dbms_output.put_line('Error Message: ---' || sqlerrm); exceptionFlag:=-1; END verifypl;    More>>

I have a PL,it like follows:



CREATE OR REPLACE PACKAGE BODY LOGIN_FUNCTION AS


PROCEDURE verifypl(


userName IN CHAR,


userPassword IN CHAR,


cur_verifypl_data OUT curLogin,


exceptionFlag OUT NUMBER


) IS


l_sql VARCHAR2(300);


BEGIN


l_sql := 'Select * from user_info_tbl where user_id = ''' || userName || ''' and password=''' || userPassword || '''';


Dbms_output.put_line('Excute sql: --- ' || l_sql);


OPEN cur_verifypl_data FOR l_sql;


exceptionFlag:=0;


EXCEPTION


WHEN OTHERS THEN


Dbms_output.put_line('Error Number: ---' || sqlcode);


Dbms_output.put_line('Error Message: ---' || sqlerrm);


exceptionFlag:=-1;


END verifypl;



I want to call this PL in JAVA,like that:



connection=(OracleConnection)DriverManager.getConnection(url,"eino","eino");


OracleCallableStatement cs = (OracleCallableStatement)connection.prepareCall("{?=call LOGIN_FUNCTION.verifypl()}");



But above statements are error,I want to know how to define parameter in LOGIN_FUNCTION.tableinfopl in Java,how to realize this function?


Any idea will be appreciated!


Thanks!!!


Edward

   <<Less
About | Sitemap | Contact