BC4j Selecting DB

How do I select the DB from the client.
I finnally figured out how to select the DB from my
application but how do I do it from a BC4J Client.
The Client is local to the AppModule.
By the way this is sure not how the how to document explains it.
From the application I
String user = args[2];
String password = args[3];
String connection = args[4];
MyConfiguration mc = new MyConfiguration(user,password,connection);
then
am =
oracle.jbo.client.Configuration.createRootApplicationModule
("ACUtility.ApplicationModule1", applicationConfig, mc);
package ACUtility;
import java.util.Hashtable;
import oracle.jbo.common.ampool.EnvInfoProvider;
import oracle.jbo.client.Configuration;
public class MyConfiguration implements EnvInfoProvider
String user;
String password;
String connection;
MyConfiguration(String user, String password, String connection)
this.user = user;
this.password = password;
this.connection = connection;
public MyConfiguration()
public Object getInfo(String info, Object env)
if (info == null)
((Hashtable)env).put(Configuration.DB_USERNAME_PROPERTY, user);
((Hashtable)env).put(Configuration.DB_PASSWORD_PROPERTY, password);
((Hashtable)env).put(Configuration.DB_CONNECT_STRING_PROPERTY, connection);
return null;
public void modifyInitialContext(Object p0)
public int getNumOfRetries()
return 0;
}

Second try to get response

Similar Messages

  • Java.lang.NoClassDefFoundError: oracle/jbo/common/ampool/ApplicationPoolException

    Oracle 9iAS J2EE Container 2.0 running on Sun Solaris 5.8
    Development Env:
    Oracle 9i JDeveloper Release Candidate running on Win2000
    I have created a few JSPs in Jdeveloper and they work fine in the embedded OC4J server on Windows.
    Then I downloaded oc4j_extended.zip and unzipped and installed in the Solaris box using the Readme.txt instructions. Then I deployed my .deploy file directly to Oracle 9iAS from Jdeveloper9i.
    When I try to reach the page of on the appserver I got the following error:
    Request URI:/vca/Virtual.jsp
    Exception:
    java.lang.NoClassDefFoundError: oracle/jbo/common/ampool/ApplicationPoolException
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName0(Compiled Code)
         at java.lang.Class.forName(Compiled Code)
         at com.evermind.server.ApplicationContextClassLoader.findClass(Compiled Code)
         at java.lang.ClassLoader.loadClass(Compiled Code)
         at java.lang.ClassLoader.loadClass(Compiled Code)
         at oracle.jsp.parse.JspUtils.loadClassJDK(Compiled Code)
         at oracle.jsp.parse.JspUtils.loadClass(Compiled Code)
         at oracle.jsp.parse.JspRTTag.(JspRTTag.java:100)
         at oracle.jsp.parse.JspParseState.createTagParser(Compiled Code)
         at oracle.jsp.parse.JspParseTag.parseNextTag(Compiled Code)
         at oracle.jsp.parse.JspParseTagFile.parse(Compiled Code)
         at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:40)
         at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:280)
         at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:173)
         at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:362)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:357)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:145)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:356)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:306)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(Compiled Code)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
         at com.evermind.server.http.HttpRequestHandler.processRequest(Compiled Code)
         at com.evermind.server.http.HttpRequestHandler.run(Compiled Code)
         at com.evermind.util.ThreadPoolThread.run(Compiled Code)
    Does the installation file for oc4j missing some libraries? I thought they would be already installed? Should I manually copy them from the embedded oc4j from my Windows installation. If yes, which files?
    Please help.
    Regards,
    D.C.

    You need to configure oc4J_extended with BC4J runtime libraries in order to run BC4J applications.
    Check out the information in help system
    Launch JDev Help system
    Select "packaging and deploying"
    Select "Ways to deploy Business components for Java (Bc4J)"
    Select "Loading BC4J runtime libraries to oc4J"
    raghu
    JDev Team

  • ADF UIX LOV and JBO-33035

    I'm working on a UIX form which is based on a view, ViewA, which is built up from two entities - e.g. EntA and EntB. Between the entities there is a relation EntA is the child and EntB is the parent. In the view definition EntA is updateable and EntB is not updateable but referenced. ViewA contains all of the fields from EntA (including the foreign key) and Name field from EntB. I also created ViewB which is based on EntB.
    ViewA now has the following fields:
    AId (based on EmpA.Id, updateable)
    AField (based on EmbA.Field, updateable)
    A_B_Fk (based on EmbA.B_Fk, which is the fk. between EmpA and Emp B, updateable)
    BName (based on EmbB.Name, not updateable because of it is part of the referenced, but not updateable EntB)
    I put the views into an application module.
    After that I made a UIX input form based on ViewA. In this form the I displayed only the AField and BName fields. The latter is a messageLovInput node. Because ViewA.BName is a not updateable field I do not use 'model' attibute, I fill the text and prompt attribute with EL expressions instead. When the user presses the LOV button the LOV window appears. There in the 'onSelect' event I set ViewA.A_B_Fk as I saw in the 'ADF_UIX_ListOfValues' sample. Everything seams to work, the referenced EntB is properly filled according to the new value of ViewA.A_B_Fk, but I got JBO-33035: the currency has changed, the expected Key is ...
    I would like to know how should I implement a LOV in a case like this?
    It's very important for me to get through this problem, because I must solve several similar case and the closing date is so near.
    Any help appreciated,
    Gábor

    Ryan,
    Thanks, I've read it and I did my LOV based on that.
    But:
    In that article the LOV field (department id) was just a simple attribute of the EmployeesView and if you had changed dept. id then nothing else would have changed in EmployeesView. In my example if you changed ViewA.A_B_Fk then ViewA.BName would change!
    The problem could be the following (Suppose thet the ViewA edit form is in EditViewA.uix, and the LOV page is LOV.uix):
    If you change ViewA.A_B_Fk in LOV.uix (as we can see in the examle you mentioned) BC4J selects the appropriate EntB and fills ViewA.BName properly. After that EditViewA.uix is refreshed and prepareMethod called. It notifies that the referenced entity is not the same as before and it throws the exception (I don't know why).
    I made a workaround: in LOV.uix I put the selected value into a session variable and I use this value in the lovUpdate event of EditViewA.uix. It seems it works but it could be nicer.
    What do you think about this?
    Gábor

  • Problems with BC4J input select tag when its bounded to a primary key field

    HI..
    I have an jsp BC4J edit form. This form uses a BC4J input select tag. This component is mapping one of the primary key Entity fields.
    When im working with this component and it doesnt map a primary key field it shows the default "none" value when im inserting a record(thats Ok). but when it maps a primary key field the default value is a database value so it is not advisable.. How can i do in order to fix that?
    Thank you

    The none value is only shown when the field accepts null values.

  • How to preserve table selections in bc4j?

    In a bc4j table with multiple selection, how do I preserve the selections when I navigate the table back and forth? I see examples, which show do-it-yourself data-bound table but not for bc4j.

    I did something similar, but my table was in a template. Here is a snippet of my code:
       * handleSelections
       * Keeps track of the rows that the user has selected from one
       * page to the next.
      private static void _handleSelections(
        BajaContext bc,
        Page page,
        PageEvent event)
        // Get the TableState from the session (the TableState keeps track
        // of the blockSize, and the startIndex)
        // the key to get the TableState from the session is the table name   
        HttpSession sess = bc.getServletRequest().getSession();
        TableState tState = (LovTableState) sess.getAttribute(_TABLE_NAME);
        if (tState == null)
          bc.getErrorLog().logMessage("Table state is null.");
          return;
        String selName = PageEventFlattenedDataSet.getFlattenedName(_TABLE_NAME,
                                                                    "selectMode");
        String selParam = event.getParameter(selName);
        // get the selections for the visible table rows.
        Boolean[] selections = tState.getSelections(); // tState has selections which is a Boolean array, the length of the table Data.
        if ( (selParam != null) &&
             ("none".equals(selParam) || "all".equals(selParam)) )
          Boolean val = new Boolean("all".equals(selParam));
          tState.setAllSelections(val);
        else
          DataSet tableInputs = new PageEventFlattenedDataSet(event,
                                                              _TABLE_NAME);
          int sz = tableInputs.getLength();
          int startRowIndex = tState.getStartIndex() - 1;
          int endRowIndex = sz + startRowIndex;
          // loop through the visible table rows.
          for (int i=0; i < sz; i++)
            // get the DataObject representing all the input elements
            // on the current table row.
            DataObject row = tableInputs.getItem(i);
            // Check if this row was selected
            Object value = row.selectValue(null, "selected");
            // Record the state of the selection of this row.
            Boolean val = ((value == null)
                        ? Boolean.FALSE
                        : Boolean.TRUE);
            tState.setSelections( (startRowIndex + i), val);
          return;
      }and a snippet of the uit file:
    <tableSelection>
    <multipleSelection data:selected="." data:selection="selections@tableState@data:rootAttr"/>
    </tableSelection>
    I'll try to take a closer look at your code to see what you might be doing wrong, but hopefully my code snippet will help.

  • How to update a bc4j detail table based on master selection

    I have a bc4j table with single selection set.
    When I retrieve the index of the single selection and set the current row in my view object based on that index my detail view object does not update its record.
    Only when I am first populating my master view object does the detail view object update or if I set a small range and change between index ranges.
    I thought by changing the current row in the master view object the detail view object listener would handle cause the detail view to update.
    Please Help.

    This looks like a question better suited for the JDeveloper forum. I'd venture a guess that it's a problem with the setup of your associations.

  • [BC4J] Table with AttributeListBinding does not highlight selected row(s)

    Hi,
    I'm using a JTable with a AttributeListBinding (from BC4J-9.0.4.3) in a FatClient application.
    JTable myTable = new JTable();
    myTable.setModel(
      JUTableBinding.createAttributeListBinding(getPanelBinding(),
         myTable,
         _vo.getName(),
         null,
         _vo.getName()+"Iter",
        new String[]{
           "Attrib1",
           "Attrib2"
    myTable.setRowSelectionAllowed(true);This way, the second row is selected (shows the Cursor cell border at the expected row) but the row background is not the SelectionBackgroundColor.
    Is there a simple way to force SelectionBackgroundColor on stelected rows?
    bye
    TPD

    This is my solution:JTable myTable = new JTable(){
       @Override
       public boolean isRowSelected(int pRow){
          return pRow = _vo.getCurrentRowIndex();
    myTable.setModel(
      JUTableBinding.createAttributeListBinding(getPanelBinding(),
         myTable,
         _vo.getName(),
         null,
         _vo.getName()+"Iter",
        new String[]{
           "Attrib1",
           "Attrib2"
    myTable.setRowSelectionAllowed(true);

  • "Verify that you have selected the right BC4J package"??

    Through out the "Dev guide", while describing steps to create Association Objects, view Link, etc, it has been mentioned to "Verify that you have selected the right BC4J package". What does it actully mean? What is the 'right' BC4J package. In various sites(Anil Passi), I have noticed, they have created three packages, server, schema and webui. But, nowhere in the documentation, did I find that these packages need to be created for "custom development". Will I run into issues, if I create packages with a different name? Are there any docs explaning the different right BC4J packages that need to be created. Or is this a basic understanding that all Java Developers know and follow.
    Kindly throw some light.
    Thanks!

    vimal,
    This is not mandatory that you have to create these packages but these are the standards, which need to be followed.
    In toolbox tutorial you will find the description about the packages structures.
    Regards,
    Gyan

  • 3.2; BC4J, GridControl; Select row programatically?

    Hi,
    I need to programatically Highlighted a desired row (which i know the primary key) from a grid and scroll the grid to show this selected row in the view port area.
    Any property/way for this ?
    note that: define a WHERE clause for rowSetInfo and .executeQuery() cause to show only the qualified rows. and this is not my purpose.
    Please Advice.
    Ali

    Sathish,KKirk
    With your suggestion i wrote following code.
    It found the desired row and highlighted, but grid doesn't scroll to show this row on the view port.
    So, now how can i scroll the grid to show the row?
    try{
    ScrollableRowsetAccess systemRs = (ScrollableRowsetAccess)SystemViewRowSetInfo.getRowsetAccess();
    systemRs.absolute(1);
    do{
    ImmediateAccess iSys= (ImmediateAccess)systemRs.getColumnItem("SystemCode");
    String sSys = iSys.getValueAsString();
    if (sSys.equals(100)) {
    break;
    }while (systemRs.next());
    }catch(Exception ex){
    ex.printStackTrace();
    null

  • BC4J smarter way to:   select sysdate from dual  ????

    Our architecture uses the DB server's date/time as the application's single
    place to get date / time. So our UI's / business logic needs sysdate in several
    places through screen flow and VO/Entities called by the business logic.
    I'll create a SQLView at design time to package calling select sysdate from dual.
    We're currently using Dynamic unnamed Views which are more expensive than just
    getting sysdate deserves and also are a memory leak if you don't
    call vo.remove() after you're done with the result set.
    But is there a simplier or smarter way to get sysdate from the DB than the more
    heavy weight than seems necessary step of instantiating a VO and creating a
    result set to get the String sysdate???
    Thanks,
    curt

    I cache viewObjects in the MT using some ViewObjectManager and had no
    problems till now (more then 6 months of production). Any AM that
    serve dynamic requests should have own ViewObjectManager-object.
    import oracle.jbo.*;
    import java.util.Hashtable;
    import java.util.Enumeration;
    public class ViewObjectManager {
    private ApplicationModule _appMod;
    private Hashtable _viewObjectNames;
    public ViewObjectManager(ApplicationModule am) {
    _appMod = am;
    _viewObjectNames = new Hashtable();
    public ViewObject getViewObject( String selectClause_,
    String fromClause_,
    String whereClause_ ) {
    ViewObject vo_ = null;
    String sqlStmt_ = _getSQLStmtFromClauses
    ( selectClause_, fromClause_, whereClause_ );
    String key_ = sqlStmt_;
    String voName_ = (String)_viewObjectNames.get(key_);
    boolean isNew_ = ( voName_ == null );
    if ( !isNew_ ) {
    vo_ = appMod.findViewObject(voName);
    if ( vo_ == null ) {
    viewObjectNames.remove(key);
    isNew_ = true;
    if ( isNew_ ) {
    vo_ = appMod.createViewObjectFromQueryStmt( null, sqlStmt );
    viewObjectNames.put( key, vo_.getName() );
    return vo_;
    private String getSQLStmtFromClauses( String selectClause,
    String fromClause_,
    String whereClause_ ) {
    return
    "SELECT "+selectClause_
    +" FROM "+fromClause_
    +( whereClause_ == null || whereClause_.equals("")
    ? "" : " WHERE "+whereClause_ ) ;
    Client method in this case looks like that:
    public static synchronized BigDecimal getNewId
    ( RequestOnNewId request__,
    QueryableApplicationModule am__ ) {
    String viewObjectName_ = request__.viewObjectName,
    sequenceName_ = request__.sequenceName,
    fromClause_ = request__.fromClause;
    BigDecimal new_id_ = null;
    ViewObject vo_;
    Row row_;
    Object obj_;
    vo_ = am__.getViewObjectManager()
    .getViewObject( sequenceName_+".NEXTVAL AS \"NEWID\"",
    "DUAL",
    null );
    vo_.executeQuery();
    row_ = vo_.first();
    obj_ = row_.getAttribute("NEWID");
    new_id_ = (obj_ == null) ? null : ((Number)obj_).bigDecimalValue();
    return new_id_;
    Hope this helps.
    Arkadi Ganov
    [email protected]

  • UIX/XML BC4J  Retaining multiple selection in tables

    We have a table with multiple selection, and we want the items to remain selected after the page refresh for some reason. Whats the cheapest way to obtain this?

    Data bind the selection attribute of multipleSelection to "someKey@ctrl:eventResult". Then in your event handler use an oracle.cabo.ui.data.ServletRequestDataSet and attach it to the event result, under the key "someKey".
    When the page is refreshed it should remember the multiple selection.
    Regards,
    John Fallows
    Oracle Corporation.

  • DID YOU KNOW?: Debugging with BC4J Tester

    Did you know that in JDeveloper 3.2, you can run the BC4J tester in debug mode to exercise your business components and hit breakpoints at the same time?
    Just do the following:
    [list]
    [*]Expand the navigator node for your Application Module, revealing its XML and Java implementation files.
    [*]Right-mouse on the YourAppModImpl.java file, and select Debug...
    [list]
    By default, it will debug using the "local mode" connection configuration. If you want it to debug using a difference configuration, just change the configuration name that appears as the 2nd argument in the launchTester call in the main() method of the application module implementation file.

    grin Thanks, Steve.
    Does this mean that in JDev 5.0 we're going to see an animated Steven Muench head in a tiny window in the lower corner, occassionally tapping on the glass to offer us hints?

  • UIX 2.2.8: Difference between bc4j:_null and null/

    Anyone here who can explain me the difference between <boundAttribute name="attrName">
      <contextProperty select="bc4j:_null"/>
    </boundAttribute> and <boundAttribute name="attrName">
      <null/>
    </boundAttribute> Does <contextProperty select="bc4j:_null"/> work when using EL?
    Thanks, Markus

    ping

  • How to get the column values from a BC4J View Table in UIXML?

    I am using a default UiXML Application for Order Entry system with Orders & Order Lines & Customers. I have a uix file OrdersView1_View.uix which displays (no updateable columns) all the Orders. How do I get the column value of a selected row in a BC4J Table (example:OrdersId) when a Submit button is pressed using UIXML or Java Classes?
    I appreciate any help on this.

    Hi,
    You need to use keyStamp, an example:
    <bc4j table name="orders">
    <bc4j:keyStamp>
    <bc4j:rowKey name="key" />
    </bc4j:keyStamp>
    Furthermore, you can automatically send the selected row key using the go event handler, so in the handlers section you could send the key to an orderInfo page:
    <event name="show">
    <!-- forward to the update page, passing
    the selected key as a page property -->
    <ctrl:go name="orderInfo" redirect="true">
    <ctrl:property name="key">
    <ctrl:selection name="orders" key="key" />
    </ctrl:property>
    </ctrl:go>
    </event>

  • Problem  with BC4J in 10g: incorrect Date formatting

    I have PL/SQL procedure, which is called from bc4j-struts-application like this:
    CallableStatement cs = getDBTransaction().createCallableStatement(FIND_USER_RESP_STMT,0);
    cs.execute();
    It return an exeption with this message:
    ORA-01403: no data found
    ORA-06512: at "CRN.CRN_UTIL", line 115
    ORA-06512: at "CRN.CRN_UTIL", line 323
    ORA-06512: at "CRN.CRN_RESPONSIBILITY", line 85
    ORA-01843: not a valid month
    ORA-06512: at line 1
    I don't send any data parameter for this procedure. When I try to call it from JDeveloper connections debug, it runs succesfully. I try to create bc4j entity to query:
    select to_char(sysdate, 'DD-MON-YYYY') X,
    to_char(sysdate, 'DD-MM-YYYY') Y from dual
    and it retrieves:
    27-¿¿¿-2004
    27-09-2004
    Date constant is used in PL/SQL procedure with format 'DD-MON_YYYY', but I can't change it, because it used by many other applications.
    My local setting is english, USA, and I have the second language on my PC - russian.
    JDeveloper 9.0.5.2. This code runs succesfully in JDeveloper 9.0.3.3.
    How can I send bc4j date setting in normal format to solve this problem? And where can I find bc4j local settings, which are sended by bc4j to server?
    Regards, Nikolay

    Hello,
    The problem is still available. Could anybody help?
    Regard

Maybe you are looking for