Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling a method in ValueChangeListener

twinklin_girlMar 13 2014 — edited Mar 19 2014

Hello,

I need to do the following :

after input of a value , I need to call a pl/sql function . If that function returns true , the value input is valid.

If that function returns false, the value is invalid and the user is shown an alert.

I have done the following :

1) Bind that inputText .

2) Created a *bean.java

3) The valueChangeListener of that input text calls a method.

My question is how to call a pl/sql function in that method ??I have written the following code:

    public void validateformula(ValueChangeEvent valueChangeEvent)

    {

        System.out.println("TEST!");  

        CallableStatement cs2=null;

        try{

           System.out.println("inside 2nd try ");

           cs2=getDBTransaction().createCallableStatement("begin ? := funcionName(?); end;",0);

           System.out.println("after ");

           cs2.registerOutParameter(1, Types.BOOLEAN);

           System.out.println("here ");

           cs2.setString(2, it4);

           cs2.executeUpdate();

           boolean retvalue2 = cs2.getBoolean(1);

           if(retvalue2)  

           {  

               throw new JboException("Invalid Value !");

           }

           else {                 

                        System.out.println("Valid Value");

           }

           }catch(SQLException f){

                             throw new JboException(f);

        }  

    }

I get the following errors :

Error(321,16):  cannot find method getDBTransaction()

Error(325,15):  cannot find method setString(int,oracle.adf.view.rich.component.rich.input.RichInputText)

Any help please ?

This post has been answered by Cvele_new_account on Mar 18 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2014
Added on Mar 13 2014
29 comments
1,160 views