ADF

How to select all JDBC Database Change Notification Registrations and clean them?

Question: How do I select all database change notifications registered via JDBC driver by my DB user? Answer: select * from user_change_notification_regs Question: How do I clean all of my DB change notifications? Answer: Database change notifications registered via JDBC driver can be deregistered only the same way – using JDBC driver. Therefore you need to execute this code: This…

Continue Reading

ADF

I get JBO-25200: Application module is not connected to a database exception. What can be the reason?

Problem Time to time “JBO-25200: Application module is not connected to a database” exception is raised while browsing ADF application Solution Tune ADF application module by disabling “Support Dynamic JDBC Credentials”. However this solution may not work in your case, depends on the root cause. Comment If I understand this option correctly, it is needed only when application users must…

Continue Reading

ADF, JDeveloper

How to iterate through all view object rows irrespective of specified range size and without impact to current rowset?

ProblemImagine we have iterator binding EmployeesViewIterator with specified range size 25. But we want to iterate through ALL employees available, not just 25 of current range. Solution Create new row set iterator from EmployeesView view object. It will contain ALL rows irrespective of specified range size. Iterate it ! DCIteratorBinding it = (DCIteratorBinding)BindingContext.getCurrent().getCurrentBindingsEntry().get(“EmployeesViewIterator”);RowSetIterator rsi = it.getViewObject().createRowSetIterator(null);   while (rsi.hasNext()) {     Row row = rsi.next());   …

Continue Reading

ADF

ADF how to stretch table vertically and horizontally?

How to stretch ADF table vertically to fill maximum available vertical space in browser? Answer: Put table into af:panelStretchLayout component center facet. Put dimensionsFrom=”parent” attribute into af:panelStretchLayout (parent of af:panelStretchLayout component must stretch its children) How to stretch ADF table horizontally to fill maximum available horizontal space in browser? Answer: Put table into af:panelStretchLayout component center facet. Add styleClass=”AFStretchWidth” attribute to af:panelStretchLayout Example:   <af:panelStretchLayout…

Continue Reading

ADF, ADF Exceptions

ADF java.lang.ClassCastException: …ViewRowImpl cannot be cast to …ViewRow ?

For example: java.lang.ClassCastException: model.DepartmentsViewRowImpl cannot be cast to model.common.DepartmentsViewRow JDeveloper, when generating View Object Row client interface sometimes goes wrong with class definition. Such error can be displayed when implementation of class is not defined. In particular error sample –  “implements DepartmentsViewRow” is missing in DepartmentsViewRowImpl class: public class DepartmentsViewRowImpl extends ViewRowImpl implements DepartmentsViewRow { … }

ADF, Database, SQL and PL/SQL

ADF method for calling DB procedures, executing other SQL statements with input and output parameters

How to call DB procedure with input and output parameters. Here I provide an example of ADF method which can be used with any number of in/pout parameters used in any order:     public void runStatement(String stt, boolean commit, ArrayList<Map<String, Object>> pars) {                  CallableStatement st = this.getDBTransaction().createCallableStatement((stt), 0);      …

Continue Reading

ADF

How to output text with line breaks in ADF ?

If we use regular “af:outputtext” component to print text with line breaks (new line symbols like “n” or  “rn”)  in ADF – we don’t succeed. Text is displayed in one line regardless of those symbols. Instead we need to use  “af:outputFormatted” component. But it is not enough. While it does not understand “n” or “rn” symbols, we need to use HTML…

Continue Reading