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!

Execute VO Query in VOImpl

880439May 21 2012 — edited May 21 2012
Hi All,
I am using jdev 11.1.2.1.0

I have a VO having query with multiple binding variables in it.
This query is fired on page load and data grid on UI is populated.
I did some change in components to load new data.
On Load button click, I need to again populate data grid with different values based on the user input.
For this, I have created new query string in managed bean. This new query string is almost same as VO query but in here, there are no ? marks.(VO query has 25 ? marks). But this new query string has all ? positions have filled up with new data.
Also, I have created a method in VOImpl, passed query string and order by clause:
    public void setCustomQuery(String query, String orderBy){
        this.setQuery(query);
        this.setOrderByClause(orderBy);
        this.executeQuery();
    }
I am calling this method from managed bean and passing query string and order by clause as parameter, as shown below:
        DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        OperationBinding opBinding = bindings.getOperationBinding("setCustomQuery");
        opBinding.getParamsMap().put("query", getSQL());
        opBinding.getParamsMap().put("orderBy", " OptionID ");
        opBinding.execute();
But It is not showing new data in the datagrid. I have given Load button as partial trigger to table(data grid).

Exception throwing is index 1 out of range
I think it because of VO query has ? marks. So it is looking for binding var's. That's why it is throwing exception.
How can we set in here @ VOImpl class: not to consider question marks?
How to implement this?

Appreciate your help...

Thanks and Regards,
Madhav K.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2012
Added on May 21 2012
10 comments
936 views