Vo.executeQuery() not working

Hi All,
I am new to the world of OAF.I need to customize an OAF page(11i). I am trying to populate data from FND table using VO.
My VO query:
<SQLQuery><![CDATA[
select lookup_code as  skuid1,meaning as descr, null as count_1,null as serialno , tag as tag from apps.fnd_lookup_values flv
       where     lookup_type like('WWPO_FEILD_PHY_SKU_MAINTANANCE')
      AND    enabled_flag = 'Y'
      AND    NVL ( start_date_active, TO_CHAR ( SYSDATE, 'DD-MON-RRRR' ) ) <=
                                                                  TO_CHAR ( SYSDATE, 'DD-MON-RRRR' )
      AND    NVL ( end_date_active, TO_CHAR ( SYSDATE, 'DD-MON-RRRR' ) ) >=
                                                                  TO_CHAR ( SYSDATE, 'DD-MON-RRRR' )
      AND    LANGUAGE = 'US'
   ]]></SQLQuery>
I am using a region(Table) with a submitbutton:
My CO code:
  if (pageContext.getParameter("PopDetBtn") != null)
       am.invokeMethod("PopDet");
My AM code :
public void PopDet()
XXWWPopDetVOImpl popVO = getXXWWPopDetVO1();
popVO.setRangeSize(1);
popVO.setWhereClause(null);
popVO.setRangeSize(1);
popVO.executeQuery();
executeQuery() is not working.Data is not getting fetched. Please let me know where I am wrong.
This is my first object in OAF.
Regrads,
Debanjan

Hi Debanjan,
Your CO Code is like this ---
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
      if (pageContext.getParameter("PopDetBtn") != null) {
        am.invokeMethod("PopDet");
And I have kept the AM Code also same.
It is working for me. Please check your VO Query and try to run that query in database and check whether the query is returning data or not.
I have used the simple query ---  " select * from emp "
If you have resolved the issue, Please let me know what changes you have made.
If you are facing any other issue, you can feel free to ask.
Regards,
Pawan Sarswat

Similar Messages

  • Programatically set where clause or view criteria not working in managed bean

    I get a view using finditerator then then apply setwhere or view criteria but it does not filter the original rows. code is as follows
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");  // not working
       /*   // not working
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    /* not working
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();

    thanks for reply.
    Jdeveloper version is 11.1.1.4.0.
    Actually the vo on which I am trying to set set where is used as source to act as cursor  to get values from filtered rows using set where and copy the this cursor values to another target vo. I am not showing these source values just getting values.
    DCIteratorBinding dcIter2 =
    ADFUtils.findIterator("PlotDtl2Iterator");     
    ViewObject dvo = dcIter2.getViewObject();
    // colors to copy 
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();
    int totalCount=cvo.getRowCount();
    cvo.setRangeSize(totalCount);
    Row[] rArray=cvo.getAllRowsInRange();
    for (Row r:rArray){
    NameValuePairs nvp = new NameValuePairs();      
    nvp.setAttribute("Description",r.getAttribute("Description"));
    nvp.setAttribute("PlanNo",r.getAttribute("PlanNo"));
    nvp.setAttribute("MainAcc",r.getAttribute("MainAcc"));
    nvp.setAttribute("Plqty",r.getAttribute("Qty"));
    nvp.setAttribute("Cdkid",r.getAttribute("CdkId"));
    nvp.setAttribute("FabricCode",r.getAttribute("FabricCode"));
    nvp.setAttribute("DyeWash",r.getAttribute("DyeWash"));
    //  nvp.setAttribute("Description","test");
    Row drow = dvo.createAndInitRow(nvp);      
    dvo.insertRow(drow); 

  • IMAGEIO IS WORKING BUT BYTEARRAY IS NOT WORKING:

    Hi all
    I am getting images from gmail contacts and trying to store it in DB
    using my http code:InputStream is=urlconnection.getInputStream();
    i could able to store the inputstream in file using:
    BufferedImage filebuffer=ImageIO.read(is);
    FileOutputStream fos=new FileOutputStream("picturerecent.jpg");
    ImageIO.write(filebuffer, "jpg", fos);
    but i was trying to store it in DB using the following code but it is not working.i am having a question that
    how it writing to a file without any problem.why not to database:
    try {
           String url = "jdbc:mysql://localhost:3306/";
             String db = "test";
             String driver = "com.mysql.jdbc.Driver";
                    Class.forName(driver);
                    con = DriverManager.getConnection(url+db,"root","");
                    try{
    PreparedStatement psmnt;
         psmnt = con.prepareStatement("insert into gmailphoto(id,Photo) "+ "values(?,?)");
         psmnt.setInt(1, 9);
         psmnt.setObject(2, is, java.sql.Types.BLOB);
         int s = psmnt.executeUpdate();
           Statement st = con.createStatement();
        try{
            ResultSet rs=st.executeQuery("select photo from gmailphoto where id=9");
            if(rs.next())
              {     //byte[] bytearray = new byte[4096];
                  int size=0;
                File sImage;
    //FIRST TRY
                FileWriter wr=new FileWriter(new File("c:\\imageOutput.jpg"));
                IOUtils.copy(rs.getBlob("photo").getBinaryStream(),wr);
                //SECOND TRY
                BufferedImage bf=ImageIO.read(new ByteArrayInputStream(rs.getBytes("photo")));
                FileOutputStream fout=new FileOutputStream(new File("C:\\imageOut"));
                if(bf!=null)ImageIO.write(bf, "jpg", fout);
                if(wr!=null)
                wr.flush();
                wr.close();
              rs.close();
           }}catch(SQLException e){
                System.out.println(e);
           }Thanks a lot for help

    but i was trying to store it in DB using the following codeThere is no code here that writes to a database. There are two lots of code that write to a file.

  • Working on Tomcat Server but same code is not working on oc4j server of E-B

    Hello,
    I have a jsp page that is working properly in tomcat 6 server but when i deployed it on oc4j server 10.1.3.1.0 than it is not working. I am confuse.
    ERROR MESSAGE:
    500 Internal Server Error
    Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
    CODE JSP:
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <!DOCTYPE html PUBLIC
         "-//W3C//DTD HTML 4.01 Transitional//EN"
         "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta
         http-equiv="Content-Type"
         content="text/html; charset=ISO-8859-1" />
    <meta
         name="author"
         content="MAX" />
    <title>Test Register Page</title>
    <link
         rel="stylesheet"
         href="css/style.css"
         type="text/css"
         media="screen" />
    </head>
    <body>
    <div id="content">
    <form name="demo" onsubmit="return validate_form()" action="RegisterServlet" method="post">
    <fieldset>
         <legend>VIEW USER</legend>
         <table border=1>
              <tr>
                   <td width="200px" align="center"><b>Bank Name</b></td>
                   <td width="200px" align="center"><b>User Name</b></td>
              </tr>
              <%
                        Connection connection = null;
                        String connectionURL = "jdbc:oracle:thin:@10.38.60.55:1521:edwdevdb";
                        ResultSet rs = null;
                   Statement statement = null;
                   try
                        // Get a Connection to the database
                        Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        connection = DriverManager.getConnection(connectionURL,
    "scott", "tiger");
                        statement = connection.createStatement();
                        rs = statement.executeQuery(" SELECT user_info.USER_KEY,user_info.FI_ID,d_fi.fi_nm, user_info.User_Name from user_info INNER join d_fi on user_info.fi_id = d_fi.fi_id order by fi_nm ");
                        //Set 'authentication' flag
                        while (rs.next())
         %>
                        <tr>
                                  <td width="200px"><a href="SearchUser?bankname=<%=rs.getString("USER_KEY")%">> <%= rs.getString("FI_NM")%></a> </td>
                                  <td width="200px"><%= rs.getString("User_Name")%></td>
                        </tr>
         <%                    
                   catch(SQLException e)
                   finally
                                            rs.close();
    statement.close();
    connection.close();
         %>
         </table>
         <label> </label>
    </fieldset>
    </form>
    </div>
    </body>
    </html>
    WEB xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app     xmlns="http://java.sun.com/xml/ns/javaee"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <description>Register</description>
    <display-name>Register</display-name>
    <!-- Declare Servlets -->
    <servlet>
         <servlet-name>BaseServlet</servlet-name>
         <servlet-class>BaseServlet</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>CategoryServlet</servlet-name>
         <url-pattern>/Category</url-pattern>
    </servlet-mapping>
    <!-- Welcome File List -->
    <welcome-file-list>
         <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
    Edited by: bappy007 on Oct 10, 2010 1:57 AM
    Edited by: bappy007 on Oct 10, 2010 1:58 AM

    ERROR IN LOG FILE:
    10/10/10 15:18:55.843 edwportal: Servlet error
    java.lang.NullPointerException
         at test.jspService(_test.java:93)
         at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:619)

  • Not equal is not working

    hi
    i write code in co extension below if (!weight.equals(weight_perc)) is not working how ever if("Core Objective".equals(Coreobjective)) is working here weight & weight_perc both are integers and Core objectives are string.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject vo =(OAViewObject)am.findViewObject("ObjectivesVO");
    if ("Apply".equals(pageContext.getParameter(EVENT_PARAM)))
    String person_id = (new Integer(pageContext.getEmployeeId())).toString();
    pageContext.writeDiagnostics(this,"person_id: "+person_id,OAFwkConstants.STATEMENT);
    String s1 = pageContext.getDecryptedParameter("pObjectiveId");
    pageContext.writeDiagnostics(this,"s1 "+s1,OAFwkConstants.STATEMENT);
    String weight_perc =pageContext.getParameter("Weighting");
    pageContext.writeDiagnostics(this,"weight_perc: "+weight_perc,OAFwkConstants.STATEMENT);
    String objective= pageContext.getParameter("ObjectiveName");
    pageContext.writeDiagnostics(this,"Objective_Name: "+objective,OAFwkConstants.STATEMENT);
    String Coreobjective = objective.substring(0,14);
    pageContext.writeDiagnostics(this,"Coreobjective: "+Coreobjective,OAFwkConstants.STATEMENT);
    String query="select weighting_percent from per_objectives where objective_id ='"+s1+"'";
    String weight = null;
    try
    pageContext.writeDiagnostics(this,"Enters into try block",OAFwkConstants.STATEMENT);
    PreparedStatement ps= am.getOADBTransaction().getJdbcConnection().prepareStatement(query);
    ResultSet rs=ps.executeQuery();
    pageContext.writeDiagnostics(this,"Excute the quiery",OAFwkConstants.STATEMENT);
    while(rs.next())
    weight =rs.getString(1);
    pageContext.writeDiagnostics(this,"weight: "+weight,OAFwkConstants.STATEMENT);
    catch(Exception e)
    e.printStackTrace();
    if("Core Objective".equals(Coreobjective))
    if (!weight.equals(weight_perc))
    pageContext.writeDiagnostics(this,"ENTERS INTO EQUAL CONDITION: ",OAFwkConstants.STATEMENT);
         MessageToken[] errTokens = { new MessageToken("VOLDWEIGHTAGE", weight)};
    throw new OAException("XX_PG", "XXBPTY_COREOBJ_WEIGHT_NOCHANGE", errTokens);
    plz help me.
    Regars,
    sharif.

    Before you do equals check, you should check if any of the value is null or not.
    Both the values are numbers, but you are getting them into strings. So you have to do string compare.
    Or it's easier to get them as numbers and use logical operators as suggested by other fellow experts to compare.
    If you still want to go for Strings here is what you need to do(may be bit cautions here)
    if ((str1!=null || !"".equals(str1))&& (str2!=null || !"".equals(str2)) && str1.equals(str2)){
    Yes both of them are same
    else{
    They are different.
    Regards,
    Peddi.

  • Delete functionality is not working

    Hi
    I have two EOs on two base tables  PO_REQUISITIONS_INTERFACE_ALL  and PO_INTERFACE_ERRORS and i have one VO having both EOs attached and have the sql query in the VO as below. I attached this VO in the AM. I have a page having regions style as 'query' and construction mode as 'autoCustomizationCriteria' and in that page i have two regions one is search region and another is results region. In the results region i have a button called 'Delete' and my functionality is when ever i click on Delete i am expecting the records should be deleted in both tables. But when i click on delete record is getting deleted only from PO_INTERFACE_ERRORS table not from PO_REQUISITION_INTERFACE_ALL table. Please let me know what needs to be done to fix this issue. I am also placing the CO and AM code below
    VO Query
    SELECT xxpowlPOIntfErrorsEO.INTERFACE_TYPE,
           xxpowlPOIntfErrorsEO.INTERFACE_TRANSACTION_ID,
           xxpowlPOIntfErrorsEO.COLUMN_NAME,
           xxpowlPOIntfErrorsEO.ERROR_MESSAGE,
           xxpowlPOIntfErrorsEO.PROCESSING_DATE,
           xxpowlPOIntfErrorsEO.CREATION_DATE,
           xxpowlPOIntfErrorsEO.CREATED_BY,
           xxpowlPOIntfErrorsEO.LAST_UPDATE_DATE,
           xxpowlPOIntfErrorsEO.LAST_UPDATED_BY,
           xxpowlPOIntfErrorsEO.LAST_UPDATE_LOGIN,
           xxpowlPOIntfErrorsEO.REQUEST_ID,
           xxpowlPOIntfErrorsEO.PROGRAM_APPLICATION_ID,
           xxpowlPOIntfErrorsEO.PROGRAM_ID,
           xxpowlPOIntfErrorsEO.PROGRAM_UPDATE_DATE,
           xxpowlPOIntfErrorsEO.ERROR_MESSAGE_NAME,
           xxpowlPOIntfErrorsEO.TABLE_NAME,
           xxpowlPOIntfErrorsEO.BATCH_ID,
           xxpowlPOIntfErrorsEO.INTERFACE_HEADER_ID,
           xxpowlPOIntfErrorsEO.INTERFACE_LINE_ID,
           xxpowlPOIntfErrorsEO.INTERFACE_DISTRIBUTION_ID,
           xxpowlPOIntfErrorsEO.COLUMN_VALUE,
           xxpowlPOIntfErrorsEO.INTERFACE_LINE_LOCATION_ID,
           xxpowlPOIntfErrorsEO.INTERFACE_ATTR_VALUES_ID,
           xxpowlPOIntfErrorsEO.INTERFACE_ATTR_VALUES_TLP_ID,
           xxpowlPOIntfErrorsEO.PRICE_DIFF_INTERFACE_ID,
           xxpowlPOIntfErrorsEO.TOKEN1_NAME,
           xxpowlPOIntfErrorsEO.TOKEN1_VALUE,
           xxpowlPOIntfErrorsEO.TOKEN2_NAME,
           xxpowlPOIntfErrorsEO.TOKEN2_VALUE,
           xxpowlPOIntfErrorsEO.TOKEN3_NAME,
           xxpowlPOIntfErrorsEO.TOKEN3_VALUE,
           xxpowlPOIntfErrorsEO.TOKEN4_NAME,
           xxpowlPOIntfErrorsEO.TOKEN4_VALUE,
           xxpowlPOIntfErrorsEO.TOKEN5_NAME,
           xxpowlPOIntfErrorsEO.TOKEN5_VALUE,
           xxpowlPOIntfErrorsEO.TOKEN6_NAME,
           xxpowlPOIntfErrorsEO.TOKEN6_VALUE,
           xxpowlPOIntfErrorsEO.APP_NAME,
           xxpowlPOIntfErrorsEO.ROWID,
           xxpowlPOReqIntfAllEO.TRANSACTION_ID,
           xxpowlPOReqIntfAllEO.PROCESS_FLAG,
           xxpowlPOReqIntfAllEO.REQUEST_ID AS REQUEST_ID1,
           xxpowlPOReqIntfAllEO.PROGRAM_ID AS PROGRAM_ID1,
           xxpowlPOReqIntfAllEO.PROGRAM_APPLICATION_ID AS PROGRAM_APPLICATION_ID1,
           xxpowlPOReqIntfAllEO.PROGRAM_UPDATE_DATE AS PROGRAM_UPDATE_DATE1,
           xxpowlPOReqIntfAllEO.LAST_UPDATED_BY AS LAST_UPDATED_BY1,
           xxpowlPOReqIntfAllEO.LAST_UPDATE_DATE AS LAST_UPDATE_DATE1,
           xxpowlPOReqIntfAllEO.LAST_UPDATE_LOGIN AS LAST_UPDATE_LOGIN1,
           xxpowlPOReqIntfAllEO.CREATION_DATE AS CREATION_DATE1,
           xxpowlPOReqIntfAllEO.CREATED_BY AS CREATED_BY1,
           xxpowlPOReqIntfAllEO.INTERFACE_SOURCE_CODE,
           xxpowlPOReqIntfAllEO.INTERFACE_SOURCE_LINE_ID,
           xxpowlPOReqIntfAllEO.SOURCE_TYPE_CODE,
           xxpowlPOReqIntfAllEO.REQUISITION_HEADER_ID,
           xxpowlPOReqIntfAllEO.REQUISITION_LINE_ID,
           xxpowlPOReqIntfAllEO.REQ_DISTRIBUTION_ID,
           xxpowlPOReqIntfAllEO.ROWID AS ROW_ID1
    FROM PO.PO_INTERFACE_ERRORS xxpowlPOIntfErrorsEO, PO.PO_REQUISITIONS_INTERFACE_ALL xxpowlPOReqIntfAllEO
    WHERE xxpowlPOIntfErrorsEO.INTERFACE_TRANSACTION_ID = xxpowlPOReqIntfAllEO.TRANSACTION_ID AND xxpowlPOIntfErrorsEO.INTERFACE_TYPE = 'REQIMPORT' AND xxpowlPOIntfErrorsEO.REQUEST_ID IS NOT NULL
    Controller Page Code
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package powl.oracle.apps.xxpowl.po.requisition.webui;
    import com.sun.java.util.collections.HashMap;
    //import com.sun.java.util.collections.Hashtable;
    import java.util.Hashtable;
    //import java.util.HashMap;
    import java.io.Serializable;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    * Controller for ...
    public class xxpowlPOReqIntfAllSearchPageCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
             String userClicked = pageContext.getParameter("event");
             System.out.println("Event from processFormRequest in SearchPageCO :"+userClicked);
           System.out.println("Parametere Names are :- \t" + pageContext.getParameter("UpdateImage"));
           System.out.println("Parametere Names are :- \t" + pageContext.getParameter("event"));
         if (pageContext.getParameter("event") != null &&
             pageContext.getParameter("event").equalsIgnoreCase("Update")) { 
             String ReqTransactionId=(String)pageContext.getParameter("transacitonidParam");
             String errorcolumn=(String)pageContext.getParameter("errorcolumnParam");
             String errormsg=(String)pageContext.getParameter("errormessageParam");
             String readyonly="Y"; //(String)pageContext.getParameter("readonlyParam");
             System.out.println("Requisition Transaction Id  : "+ReqTransactionId);
             System.out.println("Error Column  : "+errorcolumn);
             System.out.println("Error Message  : "+errormsg);
             System.out.println("Read Only  : "+readyonly);
             HashMap params = new HashMap(4);
             params.put("HashmapTransacitonid",ReqTransactionId);
             params.put("HashmapErrorcolumn",errorcolumn);
             params.put("HashmapErrormessage",errormsg);
             params.put("HashmapReadonly",readyonly);
             pageContext.putSessionValue("testValue",ReqTransactionId);
             //System.out.println("Transaction Id passing through HashMap :- \t" + ReqTransactionId);
             pageContext.setForwardURL("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllUpdatePG",
                                        null,
                                        OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                        null,
                                        params,
                                        true,
                                        OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
                                        OAWebBeanConstants.IGNORE_MESSAGES) ;   
    else if (pageContext.getParameter("event") != null &&
             pageContext.getParameter("event").equalsIgnoreCase("Delete")) {   
        System.out.println("Inside Delete method in SearchCO");
        String deleteTransactionID=(String)pageContext.getParameter("deleteTransactionIDParam");
        System.out.println("Transaction Id in Delete Method :- \t" + deleteTransactionID);
        MessageToken[] tokens = { new MessageToken("MESSAGE_NAME", "") };
        OAException mainMessage = new OAException("FND", "FND_MESSAGE_DELETE_WARNING", tokens);
        OADialogPage dialogPage = new OADialogPage(OAException.WARNING,mainMessage, null, "", "");
        String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
        String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
        dialogPage.setOkButtonItemName("DeleteYesButton");
        dialogPage.setOkButtonToPost(true);
        dialogPage.setNoButtonToPost(true);
        dialogPage.setPostToCallingPage(true);
        dialogPage.setOkButtonLabel(yes);
        dialogPage.setNoButtonLabel(no);
        Hashtable formParams = new Hashtable(1);
        formParams.put("transactionIdDeleted", deleteTransactionID);
        dialogPage.setFormParameters(formParams);
        pageContext.redirectToDialogPage(dialogPage);
    else if (pageContext.getParameter("DeleteYesButton") != null)
            System.out.println("Inside DeleteYesButton method in SearchCO");
            String deleteTransactionID = (String)pageContext.getParameter("transactionIdDeleted");
            System.out.println("Tranaction ID getting deleted: "+deleteTransactionID);        
            Serializable[] parameters = { deleteTransactionID };
            OAApplicationModule am = pageContext.getApplicationModule(webBean);
            am.invokeMethod("deleteItem", parameters);
            OAException message1 = new OAException("CN", "CN_QUOTA_PE_DELETED",null,OAException.CONFIRMATION, null);        
             pageContext.putDialogMessage(message1);
    else
    AMImpl.java code
       public void deleteItem(String trasnsactionID)
         Number rowToDelete = new Number(Integer.parseInt(trasnsactionID));      
         OAViewObject vo = (OAViewObject)getxxpowlPOReqIntfAllVO();
         xxpowlPOReqIntfAllVORowImpl row = null;
         int fetchedRowCount = vo.getFetchedRowCount();
         RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
         if (fetchedRowCount > 0)
           deleteIter.setRangeStart(0);
           deleteIter.setRangeSize(fetchedRowCount);
           for (int i = 0; i < fetchedRowCount; i++)
             row = (xxpowlPOReqIntfAllVORowImpl)deleteIter.getRowAtRangeIndex(i);
             Number PK = row.getTransactionId();
             if (PK.compareTo(rowToDelete) == 0)
               row.remove();
               getTransaction().commit();
               break;
         deleteIter.closeRowSetIterator();

    Thanks..I changed and unchecked the 'Reference Flag' for Interface Lines VO while adding EOs in VO and it worked as it is deleting the record in Interface Lines Table also. But here i am getting one more issue on specific scenario.
    My design of this development is as follow...
    1. Search Page in which users give some search criteria and results will be displayed in the results region on the same page. For each results record I have two buttons like 'Update' and 'Delete' so that users can delete the record or can update the record. For update i created a one more page where users can able to edit and save the data.
    Suppose I have one record in interface lines table and two records in error tables.When users given the search criteria and hit enter they found two records for same interface line. It means i have two records in error table and one record in interface table and both tables have same transaction id. So here user first try to update one record and it is working. After update he try to delete a record then I am getting below error. Please note that I am not getting this error when if i directly delete the record with out doing any update before delete.
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    My UpdatePage Controller
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package powl.oracle.apps.xxpowl.po.requisition.webui;
    import com.sun.java.util.collections.HashMap;
    import com.sun.rowset.internal.Row;
    import java.io.Serializable;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    //import oracle.apps.fnd.oam.diagnostics.report.Row;
    import oracle.apps.icx.por.common.webui.ClientUtil;
    import powl.oracle.apps.xxpowl.po.requisition.server.xxpowlPOReqIntfUpdateAMImpl;
    import powl.oracle.apps.xxpowl.po.requisition.server.xxpowlPOReqIntfUpdateEOVOImpl;
    * Controller for ...
    public class xxpowlPOReqIntfAllUpdatePageCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
         xxpowlPOReqIntfUpdateAMImpl am = (xxpowlPOReqIntfUpdateAMImpl)pageContext.getApplicationModule(webBean);
          xxpowlPOReqIntfUpdateEOVOImpl UpdateVO =(xxpowlPOReqIntfUpdateEOVOImpl)am.findViewObject("xxpowlPOReqIntfUpdateEOVOImpl");
          String newvalue = (String)pageContext.getSessionValue("testValue");     
          System.out.println("Transaction ID from processRequest UpdateCO from testValue field:"+newvalue);
          String transactionid = pageContext.getParameter("HashmapTransacitonid");
          System.out.println("Transaction ID from processRequest Hash Map in UpdateCO :"+transactionid);
          String errorcolumn = pageContext.getParameter("HashmapErrorcolumn");
          System.out.println("Error Column Name from processRequest Hash Map in UpdateCO :"+errorcolumn);
          String errormsg = pageContext.getParameter("HashmapErrormessage");
          System.out.println("Error Message from processRequest Hash Map in UpdateCO :"+errormsg);
          String readyonly = pageContext.getParameter("HashmapReadonly");
          System.out.println("Read Only value from processRequest Hash Map in UpdateCO :"+readyonly);
          if (transactionid !=null & !"".equals(transactionid)) { 
         /* Passing below four parameters to the Update Page */
          Serializable amParams[] = new Serializable[]{transactionid,readyonly,errorcolumn,errormsg} ;
          pageContext.getRootApplicationModule().invokeMethod("executexxpowlPOReqIntfUpdateEOVO", amParams);
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);      
         OAApplicationModule am = pageContext.getApplicationModule(webBean);
          if (pageContext.getParameter("ApplyButton") != null)
            System.out.println("Inside ApplyButton method in UpdatePageCO");
            OAViewObject vo = (OAViewObject)am.findViewObject("xxpowlPOReqIntfUpdateEOVO");
            String transactionid = pageContext.getParameter("HashmapTransacitonid");
            System.out.println("Transaction ID from processFormRequest Hash Map in UpdateCO-ApplyButton method :"+transactionid);
            am.invokeMethod("apply");
              pageContext.forwardImmediately("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllPG",
                                                     null,
                                                     OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                     null,
                                                     null,
                                                     true,
                                                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
           else if (pageContext.getParameter("CancelButton") != null)
            am.invokeMethod("rollback");
            pageContext.forwardImmediately("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllPG",
                                                   null,
                                                   OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                   null,
                                                   null,
                                                   true,
                                                   OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    UpdatePageAMImpl.java
    package powl.oracle.apps.xxpowl.po.requisition.server;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OARow;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.inv.appsphor.order.server.XxapOrderHeaderVOImpl;
    import oracle.jbo.Transaction;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class xxpowlPOReqIntfUpdateAMImpl extends OAApplicationModuleImpl {
        /**This is the default constructor (do not remove)
        public xxpowlPOReqIntfUpdateAMImpl() {
        /**Container's getter for xxpowlPOReqIntfUpdateEOVO
        public xxpowlPOReqIntfUpdateEOVOImpl getxxpowlPOReqIntfUpdateEOVO() {
            return (xxpowlPOReqIntfUpdateEOVOImpl)findViewObject("xxpowlPOReqIntfUpdateEOVO");
        /**Sample main for debugging Business Components code using the tester.
        public static void main(String[] args) {
            launchTester("powl.oracle.apps.xxpowl.po.requisition.server", /* package name */
          "xxpowlPOReqIntfUpdateAMLocal" /* Configuration Name */);
    /*  // Added by 
        public void execute_update_query(String TransactionID) {
        xxpowlPOReqIntfUpdateEOVOImpl vo = getxxpowlPOReqIntfUpdateEOVO();
        vo.initQuery(TransactionID);
    // Added by  , this will not call bec changed the logic and so now the update button enabled on search results page
    // and this method will not called
    public void pageInEditMode (String transactionID, String readOnlyFlag, String ErrorColumn,
                                                                           String ErrorMessage)
        System.out.println("Transaction Id from pageInEditMode in UpdatePGAMImpl.java: "+transactionID);
        System.out.println("xxReadOnly from pageInEditMode in UpdatePGAMImpl.java: "+readOnlyFlag);
        // Get the VO
        xxpowlPOReqIntfUpdateEOVOImpl updateVO = getxxpowlPOReqIntfUpdateEOVO();
        //Remove the where clause that was added in the previous run
        updateVO.setWhereClause(null);
        //Remove the bind parameters that were added in the previous run.
        updateVO.setWhereClauseParams(null);
        //Add where clause
        // updateVO.addWhereClause(" TRANSACTION_ID = :1 ");
        //Bind transactionid to the where clause.
         // updateVO.setWhereClauseParam(1, transactionID); // this will not work bec it will start with zero from from 1
          updateVO.setWhereClauseParam(0, transactionID);
        //Execute the query.
        updateVO.executeQuery();
        xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
        // Assiging the transient varaibles
        currentRow.setxxErrorMessage(ErrorMessage);
        currentRow.setxxErrorColumn(ErrorColumn);
        if ("N".equals(readOnlyFlag))
              /* Make the attribute to 'False so that all fields will be displayed in Edit Mode because we used this
               xxReadOnly as SPEL  */
               currentRow.setxxReadOnly(Boolean.FALSE);
       public void executexxpowlPOReqIntfUpdateEOVO(String transactionID, String xxReadyOnly, String ErrorColumn,
                                                                                              String ErrorMessage)
           System.out.println("Transaction Id from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+transactionID);
           System.out.println("xxReadOnly from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+xxReadyOnly);
           System.out.println("Error Message from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+ErrorColumn);
           System.out.println("Error Column from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+ErrorMessage);
         // Get the VO
         xxpowlPOReqIntfUpdateEOVOImpl updateVO = getxxpowlPOReqIntfUpdateEOVO();
         //xxpowlPOReqIntfUpdateEOVORowImpl updaterowVO = xxpowlPOReqIntfUpdateEOVO();
       //not working
       //    OARow row = (OARow)updateVO.getCurrentRow();
       //    row.setAttribute("xxReadOnly", Boolean.TRUE);
    // updateVO.putTransientValue('XXXXX',x);
         //Remove the where clause that was added in the previous run
         updateVO.setWhereClause(null);
         //Remove the bind parameters that were added in the previous run.
         updateVO.setWhereClauseParams(null);
         //Add where clause
         // updateVO.addWhereClause(" TRANSACTION_ID = :1 ");
         //Bind transactionid to the where clause.
          // updateVO.setWhereClauseParam(1, transactionID); // this will not work bec it will start with zero from from 1
           updateVO.setWhereClauseParam(0, transactionID);
        // updateVO.setWhereClauseParam(1, ErorrColumn); 
         //Execute the query.
         updateVO.executeQuery();
         /* We want the page should be read only initially so after executing the VO with above command
            and if you use next() it will go to the first record among the
            fetched records. If you want to iterate for all the records then use iterator */
            /* Using Iterator
             while(updateVO.hasNext()) {  // this will check after execute Query above command if it has any rows
              xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
              /* above line next() will take the control of the first record */
          /*     currentRow.setxxErrorMessage(ErrorMessage);
                 currentRow.setxxErrorColumn(ErrorColumn);
               if ("Y".equals(xxReadyOnly))
                      currentRow.setxxReadOnly(Boolean.TRUE);                 
             } // this while loop will loop till end of all the fetched records
         xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
      // Assiging the transient varaibles
      currentRow.setxxErrorMessage(ErrorMessage);
      currentRow.setxxErrorColumn(ErrorColumn);
        /* Make the attribute to 'TRUE' so that all fields will be displayed as READ ONLY because we used this
           xxReadOnly as SPEL
           if ("Y".equals(xxReadyOnly))
                  currentRow.setxxReadOnly(Boolean.TRUE);            
      //Added by  and this methiod will get called from UpdatePG Process Form Request controller  
         public void rollback()
           Transaction txn = getTransaction();
           if (txn.isDirty())
             txn.rollback();
        public void apply()
            //OAViewObject vo1 = (OAViewObject)getxxpowlPOReqIntfUpdateEOVO();
            //Number chargeAccountID = vo1.get
          getTransaction().commit();      
          OAViewObject vo = (OAViewObject)getxxpowlPOReqIntfUpdateEOVO();
          if (!vo.isPreparedForExecution())
           vo.executeQuery();

  • PreparedStatement not working with Oracle

    Hi All,
    I am using preparedStatement in my JDBC code to fetch/insert values from oracle9i database.
    I am checking condition like if a given record does not exist then insert it else update it.
    First time it works when there is no row in database, however for subsequent run it's not able to return me the result though that row exist in database and this resulting in DuplicateKeyException becuase it try to create the row in db again.
    The code is working fine for MySQL DB2 and SQLServer but doesn't work in case oracle 9i
    Here is mycode
    //problem is here 1st time it works next time it is not retunring true though record is there in DB.
    if(isItemExist("1","CORP"))
    updateItem("1","CORP","DESC1");
    else
    insertItem("1","CORP","DESC1");
    public boolean isItemExist(String itemid, String storeid)
    String FIND_SQL = "SELECT item_desc from item where item_id = ? and store_id = ? ";          
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    rs = ps.executeQuery();
    if(rs.next()){
         return true;
    utils.close(c, ps, rs);
    else{
         return false;
    utils.close(c, ps, rs);
    public void createItem(String itemid, String storeid, String item_desc)
    String INSERT_SQL = "INSERT INTO item(item_id,store_id,item_desc)values(?, ?, ?)";
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, itemid);
    ps.setString(i++, storeid);
    ps.setString(i++, item_desc);
    ps.executeUpdate();
    utils.close(c, ps, null);
    public void updateItem(String itemid, String storeid, String item_desc)
    String INSERT_SQL = "UPDATE item SET item_desc = ?, store_id=? WHERE item_id = ?";
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, item_desc);
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    ps.executeUpdate();
    utils.close(c, ps, null);
    Kindly suggest what's wrong with code. because same code works with other databse like SQL Server, MySQL but it is not working with oracle9i.

    if(isItemExist("1","CORP"))
    updateItem("1","CORP","DESC1");
    else
    insertItem("1","CORP","DESC1");
    String FIND_SQL = "SELECT item_desc from item where item_id = ? and store_id = ? ";
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    String INSERT_SQL = "INSERT INTO item(item_id,store_id,item_desc)values(?, ?, ?)";
    ps.setString(i++, itemid);
    ps.setString(i++, storeid);
    ps.setString(i++, item_desc);
    String INSERT_SQL = "UPDATE item SET item_desc = ?, store_id=? WHERE item_id = ?";
    ps.setString(i++, item_desc);
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);My first guess, looking at the above snippets, would be that the item_id field is a number and not a string and so you should be calling ps.setInt instead of ps.setString when setting that parameter.
    This is only a guess, however, since you have not posted what the actual error is, which will probably give a hint to what the actual error is.

  • Programatical checking of checkbox is not working in Jdeveloper 11.1.1.3.0

    Hi,
    I've a table whose first column is a checkbox bound to a ViewObject attribute(SelectFlag).
    I've another checkbox placed on column header for Select-All feature.
    The functionality is that when we check Select-All checkbox, it should check checkboxes for all the rows(first column) and when we uncheck Select-All checkbox, it should uncheck checkboxes for all the rows.
    I've the partial trigger on table for the Select-All checkbox.
    Here is the ValueChangeListener code for Select-All checkbox:
    public void checkAll(ValueChangeEvent valueChangeEvent) {
    Boolean isSelected = ((Boolean)valueChangeEvent.getNewValue()).booleanValue();
    System.out.println("New Check Value:"+isSelected);
    ViewObject vo = getIteratorBoundVO("KrcCapabilitiesVO1Iterator");
    vo.clearCache();
    vo.reset();
    vo.setWhereClause("KrcCapabilitiesEO.ACTIVITY_ID = 446");
    vo.executeQuery();
    while(vo.hasNext())
    Row row = vo.next();
    if(isSelected){
    row.setAttribute("SelectFlag",true);
    System.out.println("Checked Value for CapabilityId :: " + row.getAttribute("CapabilityId"));
    else{
    row.setAttribute("SelectFlag",false);
    System.out.println("Unchecked Value for CapabilityId :: " + row.getAttribute("CapabilityId"));
    This code is not working in latest Jdeveloper version 11.1.1.3.0 which uses WebLogic Server Version: 10.3.3.0
    It's working fine in Jdeveloper version 11.1.1.1.0 which uses WebLogic Server Version: 10.3.1.0
    Is this a bug? Can anyone help me on this please.
    Thanks,
    Bhaskar

    Hi Frank,
    Thanks for your response.
    You are right, the selection state is not shown in the table.
    I'm taking the ViewObject from Iterator Binding.
    Here is the entire code:
    public static Object evaluateEL(String el){
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext,el,Object.class);
    return exp.getValue(elContext);
    public static ViewObject getIteratorBoundVO(String voIterator)
    DCBindingContainer dcb = (DCBindingContainer)evaluateEL("#{bindings}");
    DCIteratorBinding dciter = dcb.findIteratorBinding(voIterator);
    dciter.invalidateCache();
    ViewObject vo = dciter.getViewObject();
    return vo;
    public void checkAll(ValueChangeEvent valueChangeEvent) {
    Boolean isSelected = ((Boolean)valueChangeEvent.getNewValue()).booleanValue();
    System.out.println("New Check Value:"+isSelected);
    ViewObject vo = getIteratorBoundVO("KrcCapabilitiesVO1Iterator");
    vo.clearCache();
    vo.reset();
    vo.setWhereClause("KrcCapabilitiesEO.ACTIVITY_ID = 446");
    vo.executeQuery();
    while(vo.hasNext())
    Row row = vo.next();
    if(isSelected){
    row.setAttribute("SelectFlag",true);
    System.out.println("Checked Value for CapabilityId :: " + row.getAttribute("CapabilityId"));
    else{
    row.setAttribute("SelectFlag",false);
    System.out.println("Unchecked Value for CapabilityId :: " + row.getAttribute("CapabilityId"));
    Thanks,
    Bhaskar

  • Problem with GenericCatalogDAO  JDBC Resultset using parameters not working

    Hello
    I have a problem with Petstore GenericCatalogDAO. java. The problem is the behaviour of the resultset object when retrieving data from the database.Below are two synareos one that
    works (when) hard coded and one that does not work when parameter values passed into the the result set.
    1. The code the WORKS.
    statement = connection.prepareStatement("select a.productid , name, descn from product a, product_details b
    where a.productid = b.productid and locale= 'en_US' and a.catid = 'FISH' order by name"
    ,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    resultSet = statement.executeQuery();
    resultSet.absolute(1);
    String s = resultSet.getString(1);
    The code that gives me a 'exhausted resultset' error which I think means no results
    String[] parameterValues = new String[] { locale.toString(), categoryID };(For example parameters are 'en_US' and 'FISH')
    statement = connection.prepareStatement("select a.productid , name, descn from product a, product_details b
    where a.productid = b.productid and locale=? and a.catid =? order by name"
    ,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    for (int i = 0; i < parameterValues.length; i++) {
    statement.setString(i + 1, parameterValues[i]);
    resultSet = statement.executeQuery();
    resultSet.absolute(1);
    String s = resultSet.getString(1);
    There is obviously a problem using these named parametevalues with these preparedstatement resultset, Does anybody know anything about this and a fix for it????
    Cheers. Roger

    Which version of PetStore are you using?
    -Larry

  • Submit buttons not working....:o( - ANY IDEAS??

    okay i got a form - ApplicantForm.jsp and that has two buttons on it...
    'ACCEPT' and 'REJECT'
    the next page - CurrentStatus.jsp - should be brought up but its just not working!
    whenever a button is pressed a blank screen with just the buttons is being brought up and no changes are being made to the database.
    what needs to happen is that it performs the little calculation - and the updates the value in the database...here's the code
    ApplicantForm.jsp
    (the buttons are declared at the top and the logic at the bottom)
    <%@ page import="java.sql.*, java.net.*" %>
    <HTML>
    <HEAD>
    <TITLE>APPLICANT FORM</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <FORM NAME = "ApplicantForm">
    <DIV ALIGN = "center">
    <INPUT TYPE = "submit" VALUE = "ACCEPT" NAME = "AcceptButton">
    <INPUT TYPE = "submit" VALUE = "REJECT" NAME = "RejectButton">
    </DIV>
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
    Statement st = con.createStatement();
    String forename           = request.getParameter("name");
    String surname           = request.getParameter("surname");
    String email = request.getParameter("email");
    int level = 0;
    String query = "SELECT * FROM Login_Details LD, Personal_Details PD, Education E, Work_Experience WE, Skills S WHERE LD.Email_Address = PD.Email_Address AND LD.Email_Address = E.Email_Address AND LD.Email_Address = WE.Email_Address AND LD.Email_Address = S.Email_Address AND PD.Forename = '" + forename + "' AND PD.Surname = '" + surname + "' AND LD.Email_Address = '" + email + "'";
    ResultSet rs = st.executeQuery(query);
    if(rs.next()) {
    %>
    <TABLE WIDTH="760" BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR VALIGN="top">
    <TD WIDTH="610" HEIGHT="130">
    <TABLE WIDTH="610" BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR>
    <TD WIDTH="10" HEIGHT="192" VALIGN="top"></TD>
    <TD WIDTH="600" HEIGHT="192" VALIGN="top">
    <TABLE WIDTH="600" BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR>
    <TD VALIGN="top">
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
              <TR>
              <TD COLSPAN="2"> </TD>
              </TR>          
    <TR>
    <TD COLSPAN="2"><B> <% out.println(rs.getString("Forename")); out.println(rs.getString("Surname")); %></B></TD>
    </TR>
    <TR>
    <TD COLSPAN="2" BGCOLOR="#000000"><FONT COLOR="#FFFFFF" SIZE="4">Personal Details</FONT></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="250"><FONT SIZE="2">Title</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Title")); %></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="250"><FONT SIZE="2">Forename</FONT></TD>
    <TD WIDTH="334"><% out.println(forename); %></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="250"><FONT SIZE="2">Surname</FONT></TD>
    <TD WIDTH="334"><% out.println(surname); %></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="250" HEIGHT="2"><FONT SIZE="2">Date Of Birth</FONT></TD>
    <TD HEIGHT="2" WIDTH="334"><% out.println(rs.getString("DOB")); %></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="250"><FONT SIZE="2">Sex</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Gender")); %></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="250"><FONT SIZE="2">Nationality</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Nationality")); %></TD>
    </TR>
              <TR BGCOLOR="#FFFFFF">
              <TD WIDTH="205"><FONT SIZE="2">Marital Status</FONT></TD>
              <TD WIDTH="334"><% out.println(rs.getString("Marital_Status")); %></TD>
              </TR>
              <TR BGCOLOR="#FFFFFF">
              <TD WIDTH="205"><FONT SIZE="2">Do you require a work permit?</FONT></TD>
              <TD WIDTH="334"><% out.println(rs.getString("Work_Permit_Required")); %></TD>
              </TR>
              <TR BGCOLOR="#FFFFFF">
              <TD WIDTH="205"><FONT SIZE="2">Email Address</FONT></TD>
              <TD WIDTH="334"><% out.println(email); %></TD>
              </TR>
    <TR>
    <TD COLSPAN="2" BGCOLOR="#000000"><FONT COLOR="#FFFFFF" SIZE="4">Education</FONT></TD>
    </TR>
              <TR>
              <TD COLSPAN="2"><FONT SIZE="2">Secondary Education</FONT></TD>
              </TR>
    <TR>
    <TD COLSPAN="2"><FONT SIZE="2">Institution(s)</FONT></TD>
    </TR>
    <TR>
    <TD COLSPAN="2">
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
    <TR>
    <TD WIDTH="47%"><FONT SIZE="2">Name</FONT></TD>
    <TD WIDTH="37%"><FONT SIZE="2">Location</FONT></TD>
    <TD WIDTH="7%"><FONT SIZE="2">From</FONT></TD>
    <TD WIDTH="9%"><FONT SIZE="2">To</FONT></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="32%"><% out.println(rs.getString("Institution_Name_1")); %></TD>
    <TD WIDTH="32%"><% out.println(rs.getString("Institution_Location_1")); %></TD>
    <TD WIDTH="13%"><% out.println(rs.getString("Institution_From_1")); %></TD>
    <TD WIDTH="23%"><% out.println(rs.getString("Institution_To_1")); %></TD>
    </TR>
    <TR BGCOLOR="#FFFFFF">
    <TD WIDTH="32%"><% out.println(rs.getString("Institution_Name_2")); %></TD>
    <TD WIDTH="32%"><% out.println(rs.getString("Institution_Location_2")); %></TD>
    <TD WIDTH="13%"><% out.println(rs.getString("Institution_From_2")); %></TD>
    <TD WIDTH="23%"><% out.println(rs.getString("Institution_To_2")); %></TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    <TR>
    <TD COLSPAN="2"><FONT SIZE="2">'A' Level or Equivalent</FONT></TD>
    </TR>
    <TR>
    <TD COLSPAN="2" VALIGN="top">
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="607">
    <TR>
    <TD WIDTH="18"> </TD>
    <TD WIDTH="57"><FONT SIZE="2">Year</FONT></TD>
    <TD WIDTH="250"><FONT SIZE="2">Qualification Name</FONT></TD>
    <TD WIDTH="96"><FONT SIZE="2">Subject</FONT></TD>
    <TD WIDTH="131"><FONT SIZE="2">Grade</FONT></TD>
    </TR>
    <TR>
    <TD WIDTH="18">1</TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("ALevel_Year_1")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("ALevel_Name_1")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="96"><% out.println(rs.getString("ALevel_Subject_1")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="131"><% out.println(rs.getString("ALevel_Grade_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="18">2</TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("ALevel_Year_2")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("ALevel_Name_2")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="96"><% out.println(rs.getString("ALevel_Subject_2")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="131"><% out.println(rs.getString("ALevel_Grade_2")); %></TD>
    </TR>
                   <TR>
    <TD WIDTH="18">3</TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("ALevel_Year_3")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("ALevel_Name_3")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="96"><% out.println(rs.getString("ALevel_Subject_3")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="131"><% out.println(rs.getString("ALevel_Grade_3")); %></TD>
    </TR>
                   <TR>
    <TD WIDTH="18">4</TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("ALevel_Year_4")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("ALevel_Name_4")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="96"><% out.println(rs.getString("ALevel_Subject_4")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="131"><% out.println(rs.getString("ALevel_Grade_4")); %></TD>
    </TR>
                   <TR>
    <TD WIDTH="18">5</TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("ALevel_Year_5")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("ALevel_Name_5")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="96"><% out.println(rs.getString("ALevel_Subject_5")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="131"><% out.println(rs.getString("ALevel_Grade_5")); %></TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    <TR>
              <TD COLSPAN="2"><FONT SIZE="2">Higher & PostGraduate</FONT></TD>
              </TR>
    <TR>
    <TD COLSPAN="2"><% out.println(rs.getString("Degree_Year_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Degree Qualification</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_Qualification_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Degree Subject</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_Subject_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Degree Result</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_Result_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Expected / Obtained</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_ExpObt_1")); %></TD>
    </TR>
              <TR>
    <TD COLSPAN="2"><% out.println(rs.getString("Degree_Year_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Degree Qualification</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_Qualification_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Degree Subject</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_Subject_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Degree Result</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_Result_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="250"><FONT SIZE="2">Expected / Obtained</FONT></TD>
    <TD WIDTH="334"><% out.println(rs.getString("Degree_ExpObt_2")); %></TD>
    </TR>
    <TR>
    <TD COLSPAN="2" BGCOLOR="#000000"><FONT COLOR="#FFFFFF" SIZE="4">Work Experience</FONT></TD>
    </TR>
    <TR>
    <TD COLSPAN="2"><FONT SIZE="2">Employer 1</FONT></TD>
    </TR>
    <TR>
    <TD COLSPAN="2" BGCOLOR="#FFFFFF" VALIGN="top">
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
    <TR>
    <TD WIDTH="30%"><FONT SIZE="2">Employer</FONT></TD>
    <TD COLSPAN="2"><% out.println(rs.getString("Employer_Name_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="30%"><FONT SIZE="2">Dates</FONT></TD>
    <TD WIDTH="17%"><FONT SIZE="2">From</FONT></TD>
    <TD WIDTH="53%"><% out.println(rs.getString("Start_Date_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="30%"> </TD>
    <TD WIDTH="17%">To</TD>
    <TD WIDTH="53%"><% out.println(rs.getString("End_Date_1")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="30%"><FONT SIZE="2">Role</FONT></TD>
    <TD COLSPAN="2"><% out.println(rs.getString("Role_1")); %></TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    <TR>
    <TD COLSPAN="2"><FONT SIZE="2">Employer 2</FONT></TD>
    </TR>
    <TR>
    <TD COLSPAN="2" BGCOLOR="#FFFFFF" VALIGN="top">
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
    <TR>
    <TD WIDTH="30%"><FONT SIZE="2">Employer</FONT></TD>
    <TD COLSPAN="2"><% out.println(rs.getString("Employer_Name_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="30%"><FONT SIZE="2">Dates</FONT></TD>
    <TD WIDTH="17%"><FONT SIZE="2">From</FONT></TD>
    <TD WIDTH="53%"><% out.println(rs.getString("Start_Date_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="30%"> </TD>
    <TD WIDTH="17%">To</TD>
    <TD WIDTH="53%"><% out.println(rs.getString("End_Date_2")); %></TD>
    </TR>
    <TR>
    <TD WIDTH="30%"><FONT SIZE="2">Role</FONT></TD>
    <TD COLSPAN="2"><% out.println(rs.getString("Role_2")); %></TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
              <TR>
    <TD COLSPAN="2" BGCOLOR="#000000"><FONT COLOR="#FFFFFF" SIZE="4">Other Skills</FONT></TD>
    </TR>
         <TR>
    <TD COLSPAN="2" VALIGN="top">
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="807">
    <TR>
                   <TD COLSPAN="2"><FONT SIZE="2">Foreign Languages</FONT></TD>
                   </TR>
                   <TR>
    <TD WIDTH="57"><FONT SIZE="2">Language</FONT></TD>
    <TD WIDTH="250"><FONT SIZE="2">Proficiency</FONT></TD>
    </TR>
    <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Language_1")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Language_Prof_1")); %></TD>
    </TR>
                                  <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Language_2")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Language_Prof_2")); %></TD>
    </TR>
                                  <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Language_3")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Language_Prof_3")); %></TD>
    </TR>
                   <TR>
                   <TD COLSPAN="2"><FONT SIZE="2">IT Skills</FONT></TD>
                   </TR>
                   <TR>
    <TD WIDTH="57"><FONT SIZE="2">Skill</FONT></TD>
    <TD WIDTH="250"><FONT SIZE="2">Proficiency</FONT></TD>
    </TR>
                   <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Skill_1")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Skill_Prof_1")); %></TD>
    </TR>
                   <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Skill_2")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Skill_Prof_2")); %></TD>
    </TR>
                   <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Skill_3")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Skill_Prof_3")); %></TD>
    </TR>
                   <TR>
    <TD BGCOLOR="#FFFFFF" WIDTH="57"><% out.println(rs.getString("Skill_4")); %></TD>
    <TD BGCOLOR="#FFFFFF" WIDTH="250"><% out.println(rs.getString("Skill_Prof_4")); %></TD>
    </TR>     
                   </TABLE>          
                   </TABLE>
              </TABLE>
         </TABLE>
    </TABLE>
    <%
    if(request.getParameter("RejectButton") != null) {
    level = Integer.parseInt(rs.getString("Level_ID"));
    level = 4;
    String levelString = Integer.toString(level);
    session.setAttribute("email", email);
    session.setAttribute("level", levelString);
    response.sendRedirect("CurrentStatus.jsp");
    else if(request.getParameter("AcceptButton") != null) {
    level = Integer.parseInt(rs.getString("Level_ID"));
    if(level < 4) {
    level = level + 1;
    String levelString = Integer.toString(level);
    session.setAttribute("email", email);
    session.setAttribute("level", levelString);
    else {
    level = 4;
    String levelString = Integer.toString(level);
    session.setAttribute("email", email);
    session.setAttribute("level", levelString);
    response.sendRedirect("CurrentStatus.jsp");
    st.close();
    con.close();
    %>
    </FORM>
    </BODY>
    </HTML>
    CurrentStatus.jsp
    <%@ page import="java.sql.*, java.net.*" %>
    <HTML>
    <HEAD>
    <TITLE>APPLICANT FORM</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
    Statement st = con.createStatement();
    String level                = (String)session.getAttribute("level");
    String email = (String)session.getAttribute("email");
    String query = "UPDATE Login_Details SET Level_ID = '" + level + "' WHERE Email_Address = '" + email + "'";
    st.executeUpdate(query);
    %>
    <DIV ALIGN = "center">
    <H2> Candidate status has been moved to: <% out.println(level); %></H3>
    </DIV>
    </BODY>
    </HTML>
    <%
    st.close();
    con.close();
    %>
    any ideas at all??? please??! :o(

    instead of using a submit input try using two button inputs, names can be the same.
    <input type='button' value='accept' name='aButton' onClick='js_func("accept")'>
    <input type='button' value='reject' name='aButton' onClick='js_func("reject")'>
    write a javascript function and catch the value sent and redirect to a controller (a jsp or a servlet) which would re-route the request to your bean
    function js_function(theValue)
    window.location = "controller.jsp?action=" + theValue
    this is how you can make a button act as a submit button. i guess this is your best bet.
    cem.

  • Commit not working with actionBinding

    I am having a bit of a problem, i am trying to change a value from an iterator (this part work fine) but can't commit this value for some reason but i get no error.
    I click on the button that will change the value of the selected row in the table.
    First sysout return the right value.
    second sysout return "N" which is good.
    third sysout return "Y" which is what i want to do.
    I do have a commit action in my page definition.
    I tried addind a button that will commit but no success here.
    Any help ?
    public String disableSelectedProject(){
    RowKeySet selectedRowKeys = table1.getSelectionState();
    //Store original rowKey
    Object oldRowKey = table1.getRowKey();
    if (selectedRowKeys != null)
    Iterator iter = selectedRowKeys.getKeySet().iterator();
    if (iter != null && iter.hasNext())
    Object rowKey = iter.next();
    System.out.println(rowKey.toString());
    //set the current row in the ADF binding to the same row
    DCIteratorBinding dcib = (DCIteratorBinding)bindings.get("ProjectList1Iterator");
    dcib.setCurrentRowWithKeyValue(rowKey.toString());
    Row rowData = dcib.getCurrentRow();
    System.out.println( rowData.getAttribute(ProjectListRowImpl.ISDELETED));
    //set the field flag to Deleted
    rowData.setAttribute(ProjectListRowImpl.ISDELETED, "Y");
    System.out.println( rowData.getAttribute(ProjectListRowImpl.ISDELETED));
    //commit the transaction - for iterators Not working for this case.
    JUCtrlActionBinding actionBinding = (JUCtrlActionBinding)bindings.get("Commit");
    actionBinding.execute();
    //refresh list
    DCIteratorBinding iterator = (DCIteratorBinding)bindings.get("ProjectList1Iterator");
    iterator.executeQuery();
    //Restore the original rowKey
    table1.setRowKey(oldRowKey);
    return "";
    Thank you

    hi Charles
    ... I am using Jdev 10.1.3.1.1 and use Application Dev framework documentation. But i did not start at the beggining of the project so i was able to looked at the code already there. ...You might want to review documentation sections:
    - "8 Implementing Business Services with Application Modules "
    at http://download.oracle.com/docs/cd/B32110_01/web.1013/b25947/bcservices.htm
    - "24 Testing and Debugging Web Applications "
    at http://download.oracle.com/docs/cd/B32110_01/web.1013/b25947/web_testdebug.htm
    You also might want to try to add more System.out.println() statements to see which statements get executed and which don't, and combine that with some try-catch statements (maybe for the whole method) like this
      try
        ; // some statements
      catch(Throwable th)
        th.printStackTrace();
        throw new RuntimeException("statements failed, th = " + th, th);
      }success
    Jan

  • Jsp:setProperty tag is not working

    hi i am working on project online test system when registering the student i want to use the setProperty tag to set the values from the student form into the approproate bean properties but this tag doesn't work instead i have to set all values of bean by calling the respective setter methods and i am using tomcat as web server.
    i am sending the code as well please help me if u can.
    the html coding for student form is
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>registration of student</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#677E7E" text="#AC9E6C">
    <table width="75%" border="1" align="center" bordercolor="#677E7E">
    <tr>
    <td><font size="5">STUDENT REGISTRATION FORM</font></td>
    </tr>
    </table>
    <hr>
    <p> </p>
    <form name="student_registration_form" method="post" >
    <script language="JavaScript" >
    function validateField()
              var
                   sos=document.student_registration_form.StartOfSession.selectedIndex,
                   eos=document.student_registration_form.EndOfSession.selectedIndex,
                   deg=document.student_registration_form.Degree.selectedIndex,
                   sem=document.student_registration_form.Smester.selectedIndex,
                   sec=document.student_registration_form.Section.selectedIndex,
                   rol=document.student_registration_form.RollNo.value,
                   pas=document.student_registration_form.Password.value;
    if(sos==0)
                        alert(" \n You Can Not Leave StartOfSession Field Empty");
    else
              if(eos==0)
                        alert("\n You Can Not Leave EndOfSession Field Empty");
              else
              if(deg==0)
                        alert("\n You Can Not Leave Degree Field Empty");
              else
              if(sem==0)
                        alert("\n You Can Not Leave Smester Field Empty");
              else
              if(sec==0)
                        alert("\n You Can Not Leave Section Field Empty");
              else
              if(rol=="")
                        alert("\n You Can Not Leave RollNo Field Empty");          
              else
              if(pas=="")
                        alert("\n You Can Not Leave Password Field Empty");          
              //document.student_registration_form.EndOfSession.value=="" || document.student_registration_form.Degree.value=="" || document.student_registration_form.Section.value=="" || document.student_registration_form.Smester.value=="" || document.student_registration_form.RollNo.value=="" || document.student_registration_form.Password.value=="")
              else
    if(!(sos==0) || !(eos==0) || !(deg==0) ||
              !(sec==0) || !(Smester==0) ||
              !(document.student_registration_form.RollNo.value=="") ||
              !(document.student_registration_form.Password.value=="")
         //document.forms[0].reset();     
    //checking validity of the password field
    var LengthOfRollNo=pas.length;
                   for(i=0;i++;i<LengthOfRollNo )
                        if(!(pas.subString(i,i++)>0))
                                  alert("please enter numaric value in the password field");
                                  return true;
                   document.student_registration_form.submit();
    self.location='StudentRegistration.jsp';
    //return true;
         student_registration_form.StartOfSession.value="";
    student_registration_form.EndOfSession.value="";
    student_registration_form.Degree.value="";
    student_registration_form.Section.value="";
    student_registration_form.Smester.value="";
    student_registration_form.RollNo.value="";
    </script>
    <table width="76%" border="1" align="center" bordercolor="#677E7E">
    <tr>
    <td width="61%"><font size="3">SESSION</font></td>
    <td width="39%">
    <table width="75%" border="1" bordercolor="#677E7E">
    <tr>
    <td><select name="StartOfSession" size="1">
    <option>Start of Session</option>
    <option>2000</option>
    <option>2001</option>
    <option>2002</option>
    <option>2003</option>
    <option>2004</option>
    <option>2005</option>
    <option>2006</option>
    <option>2007</option>
    </select></td>
    <td bordercolor="#677E7E">TO</td>
    <td><select name="EndOfSession" size="1">
    <option>End Of Session</option>
    <option>2001</option>
    <option>2002</option>
    <option>2003</option>
    <option>2004</option>
    <option>20006</option>
    <option>2007</option>
    <option>2008</option>
    <option>2009</option>
    <option>2010</option>
    <option>2011</option>
    <option>2012</option>
    <option>2013</option>
    <option>2014</option>
    </select></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><font size="3">NAME OF DEGREE</font></td>
    <td><select name="Degree" size="1">
    <option>  </option>
              <option>MCS</option>
    <option>BCS</option>
    <option>BBA</option>
    <option>MBA</option>
    <option>MPA</option>
    <option>BSIT</option>
    <option>MSIT</option>
    <option>BBIT</option>
    <option>MSIT</option>
    </select></td>
    </tr>
    <tr>
    <td>SEMESTER </td>
    <td><select name="Smester" size="1">
    <option>   </option>
              <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>11</option>
    <option>12</option>
    </select></td>
    </tr>
    <tr>
    <td>SECTION</td>
    <td><select name="Section" size="1">
    <option>   </option>
              <option>A</option>
    <option>B</option>
    <option>C</option>
    <option>D</option>
    </select></td>
    </tr>
    <tr>
    <td>ROLL NUMBER (<font size="2">NUMARIC ONLY</font>)</td>
    <td><input type="text" name="RollNo"></td>
    </tr>
    <tr>
    <td>PASSWORD</td>
    <td><input type="password" name="Password"></td>
    </tr>
    </table>
    <table width="12%" border="1" align="center" bordercolor="#677E7E">
    <tr>
    <td><input type="button" name="Submit_bt" value="Submit" onClick="validateField()" /></td>
    </tr>
    </table>
    <p> </p>
    </form>
    <p> </p>
    </body>
    </html>
    and the bean is
    import java.sql.*;
    public class StudentBean
    private String StartOfSession="",EndOfSession="",Degree="",Section="",Smester="",RollNo="",Password="",Status="",LogIn="";
    Connection cn;
    Statement stmt;
    ResultSet rs;
    public StudentBean()
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
    cn=DriverManager.getConnection("jdbc:odbc:intery");
    stmt=cn.createStatement();
    catch(ClassNotFoundException exp)
         System.out.println("class not found while obtaining connection from StudentBean.java");
                   catch(SQLException exp)
                        System.out.println("SQLException araised while obtaining a connection from StudentBean.java");
                   catch(Exception exp)
    System.out.println("exception in obtaining connection from StudentBean.java");
    public String getStartOfSession()
    return StartOfSession;
    public void setStartOfSession(String startofsession)
    StartOfSession=startofsession;
    public String getEndOfSession()
    return EndOfSession;
    public void setEndOfSession(String endofsession)
    EndOfSession=endofsession;
    public String getDegree()
    return Degree;
    public void setDegree(String degree)
    Degree=degree;
    System.out.println("Degree = "+Degree);
    public String getSection()
    return Section;
    public void setSection(String section)
    Section=section;
    public String getSmester()
    return Smester;
    public void setSmester(String smester)
    Smester=smester;
    System.out.println("yar Smesterrrrrr"+Smester+" from StudentBean");
    public String getRollNo()
    return RollNo;
    public void setRollNo(String rollno)
    RollNo=rollno;
    public String getPassword()
    return Password;
    public void setPassword(String password)
    Password=password;
    public String getStatus()
    return Status;
    public void setStatus(String status)
    Status=status;
    public String isRegistered()
    String IsRegistered="";
    LogIn=StartOfSession.concat("-").concat(EndOfSession).concat("-").concat(Degree).concat("-").concat(Section).concat("-").concat(Smester).concat("-").concat(RollNo);
    try
    PreparedStatement ps=cn.prepareStatement("select * from student where username = '"+LogIn+"'");
    rs=ps.executeQuery();
    if(rs.next())
    IsRegistered="registered";
    else
    IsRegistered="notregistered";
    catch(Exception exp)
    IsRegistered="Exception";
    System.out.println(exp+"from isRegistered method of StudentBean.java ");
    return IsRegistered;
    public boolean checkRollNo()
    try
    //rn is used to keep the value of RollNo
    int rn=Integer.parseInt(RollNo);
    catch(Exception exp)
    return false;
    return true;
    public boolean registerStudent()
                   System.out.println("rigisterStudentMethod has been called");
                        LogIn=StartOfSession.concat("-").concat(EndOfSession).concat("-").concat(Degree).concat("-").concat(Section).concat("-").concat(Smester).concat("-").concat(RollNo);
              System.out.println(LogIn);
                   try
              PreparedStatement ps=cn.prepareStatement("insert into student values(?,?,?)");
              ps.setString(1,LogIn);
              ps.setString(2,Password);
              ps.setString(3,"allowed");
              ps.executeUpdate();
              catch(SQLException exp)
    System.out.println(exp+"from StudentBean.java");
    catch(Exception exp)
    System.out.println(exp+"from StudentBean.java");
                                  System.out.println("Exception during insertion of record in student table from StudentBean.java");
                                  return false;
    return true;
    and the jsp page for seting bean property and performing other actions is
    <jsp:useBean id="StudBean" scope="page" class="StudentBean" />
    \\(here <jsp:setPropety name="StudBean" property="*" /> is not working)
    <%
    StudBean.setStartOfSession(request.getParameter("StartOfSession"));
              StudBean.setEndOfSession(request.getParameter("EndOfSession"));
    StudBean.setDegree(request.getParameter("Degree"));
    StudBean.setSmester(request.getParameter("Smester"));
    StudBean.setSection(request.getParameter("Section"));
    StudBean.setRollNo(request.getParameter("RollNo"));
    StudBean.setPassword(request.getParameter("Password"));
    if(StudBean.checkRollNo()==false)
    %>
    <%@ include file="invalid_data_in_rollno_field.htm" %>
    <%
    else
    String IsRegistered=StudBean.isRegistered();
    if(IsRegistered.equals("registered"))
    %>
    <%@ include file="already_registered.htm" %>
    <%
    else
    if (StudBean.registerStudent() && IsRegistered.equals("notregistered") )
    %>
    <%@ include file="successfull_registration.htm" %>
    <%
    else
    %>
    <%@ include file="unsuccessfull_registration_of_student.htm" %>
    <%
    %>
    please tell me where i am making mistake since i have mentioned all the
    form attributes name and the bean attributes name as same.

    I think that all your form parameters must begin with alowercase letters, for example
    startOfSession instead of StartOfSession
    try to rename your selectname paramters.
    Le me know if ti works,
    Giovanni

  • Jsp code is not working after some modification in design why?

    hi,
    I am in the final touch of my course work in jsp.i did all the coding and tested..everything was working properly..after i did some modification in the structure of the page the update query is not working..i dont understand why?
    i am attaching my old page and new page here...plz help me to solve this...
    old page editstudent.jsp
    <html>
    <body>
    <%@ page language="java" import="java.sql.*,java.text.SimpleDateFormat,java.util.Date" %>
    <%
    SimpleDateFormat formatter;
    formatter = new SimpleDateFormat("dd-MM-yyyy");
    String refno=request.getParameter("refno");
         String student=request.getParameter("student");
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con=DriverManager.getConnection("jdbc:odbc:lsmsdsn","","");
         Statement st1=con.createStatement();
    ResultSet rs=st1.executeQuery("select * from sponsordetails where refno='"+refno+"'");
    %>
    <form name=editsponsorform method="POST" action="editsponsor.jsp" >
    <input type="text" name="refno" size="20" value="<%=refno%>"></p>
    <p>Sponsor Name <input type ="text" name="sponsorname" size="50" value="<%=rs.getString(2)%>"></p>
    <p>Sponsor's Address&nbsp<textarea name="sponsorsaddress" rows="5" cols "80" tabindex="10"><%=rs.getString(3)%></textarea></p>
    <p>Sponsor's Phoneno <input type ="text" name="sponsorsphoneno" size="30" value="<%=rs.getInt(4)%>"></p>
    <p>Sponsor's Fax <input type ="text" name="sponsorsfax" size="30" value="<%=rs.getInt(5)%>"></p>
    <input type="submit" name="b1" value="Save & Continue" >
    <input type="Reset" name="b2" value="Cancel "onClick="window.location='home.html'">
    old page editsponsor.jsp
    <html>
    <body>
    <%@ page language="java" import="java.sql.*,java.text.SimpleDateFormat,java.util.*" %>
    <%
    String refno=request.getParameter("refno");
    String sponsorname=request.getParameter("sponsorname");
    String sponsorsaddress=request.getParameter("sponsorsaddress");
    String d=request.getParameter("sponsorsphoneno");
    int sponsorsphoneno=Integer.parseInt(d);
    String d1=request.getParameter("sponsorsfax");
    int sponsorsfax=Integer.parseInt(d1);
    Connection con =null;
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con=DriverManager.getConnection("jdbc:odbc:lsmsdsn","","");
         PreparedStatement st=con.prepareStatement("update sponsordetails set sponsorname= ?,sponsorsaddress=?,sponsorsphoneno=?,sponsorsfax=? where refno=?");
    st.setString(1,sponsorname);
    out.println(sponsorname);
    st.setString(2,sponsorsaddress);
    st.setInt(3,sponsorsphoneno);
    st.setInt(4,sponsorsfax);
    st.setString(5,refno);
    st.executeUpdate();     
         st.executeUpdate();
         out.println("record updated successfully"+"<A HREF='loginhtml.html'>login page</A>.");
    finally {
         try {
              if (con !=null) {
              con.close();
         catch (SQLException se)
         out.println(se.getMessage());
    %>
    </body>
    </html>
    New page editstudent.jsp
    <html>
    <body>
    <%@ page language="java" import="java.sql.*,java.text.SimpleDateFormat,java.util.Date" %>
    <%
    SimpleDateFormat formatter;
    formatter = new SimpleDateFormat("dd-MM-yyyy");
    String refno=request.getParameter("refno");
         String student=request.getParameter("student");
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con=DriverManager.getConnection("jdbc:odbc:lsmsdsn","","");
         Statement st1=con.createStatement();
    ResultSet rs=st1.executeQuery("select * from sponsordetails where refno='"+refno+"'");
    %>
    <form name=editsponsorform method="POST" action="editsponsor.jsp" onSubmit="return validateEditsponsorform()">
    <table width="821" border="1" align="center" bordercolor="#F8F8F8" bgcolor="#F5F5F5">
    <tr>
    <td colspan="6" bgcolor="#CCCCCC"><p class="style6"> </p>
    <p class="style6"> </p>
    <p class="style6"> </p></td>
    </tr>
    <tr>
    <td width="130">Ref No:</td>
    <td width="158">
    <input type="text" name="refno" disabled="true" value="<%=refno%>" />
    </td></tr>
    <tr>
    <td width="130">Sponsor Name</td>
    <td width="158">
    <input type="text" name="sponsorname" value="<%=rs.getString(2)%>"/>
    </td></tr>
    <tr>
    <td>Sponsor's Address:</td>
    <td>
    <textarea name="sponsorsaddress" cols="20" rows="5"><%=rs.getString(3)%></textarea>
    </td></tr>
    <tr>
    <td>Sponsor's Phone No:</td>
    <td>
    <input type="text" name="sponsorsphoneno" value="<%=rs.getInt(4)%>"/>
    </td></tr>
    <tr>
    <td>Sponsor's Fax:</td>
    <td>
    <input type="text" name="sponsorsfax" value="<%=rs.getInt(5)%>" />
    </td></tr>
    <tr>
    <td>
    <input type="submit" name="b1" value="Submit & continue" />
    </td>
    <td><label>
    <input type="reset" name="b2 " value="cancel" onClick="window.location='home.html'" />
    </td>
    </tr>
    </table>
    </form>
    new page editsponsor.jsp
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit</title>
    <style type="text/css">
    <!--
    .style2 {
         color: #CC6600;
         font-weight: bold;
         font-size: small;
    .style4 {
         color: #0000CC;
         font-weight: bold;
         font-size: large;
    -->
    </style>
    </head>
    <body bgcolor="#F5F7F4" topmargin="0">
    <%@ page language="java" import="java.sql.*,java.text.SimpleDateFormat,java.util.*" %>
    <div align="center">
    <table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#FBFCFF">
    <!--DWLayoutTable-->
    <tr>
    <td height="150" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <!--DWLayoutTable-->
    <tr>
    <td width="800" height="139" valign="top"><img src="images/banner copy.jpg" width="800" height="150" /></td>
    </tr>
    </table>
    <%
    String refno=request.getParameter("refno");
    String sponsorname=request.getParameter("sponsorname");
    out.println(sponsorname);//i am getting the values here.............
    String sponsorsaddress=request.getParameter("sponsorsaddress");
    out.println(sponsorsaddress);
    String d=request.getParameter("sponsorsphoneno");
    out.println(d);
    int sponsorsphoneno=Integer.parseInt(d);
    out.println(sponsorsphoneno);
    String d1=request.getParameter("sponsorsfax");
    int sponsorsfax=Integer.parseInt(d1);
    out.println(sponsorsfax);
    Connection con =null;
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con=DriverManager.getConnection("jdbc:odbc:lsmsdsn","","");
    PreparedStatement st=con.prepareStatement("update sponsordetails set sponsorname= ?,sponsorsaddress=?,sponsorsphoneno=?,sponsorsfax=? where refno=?");
    st.setString(1,sponsorname);
    out.println(sponsorname);
    st.setString(2,sponsorsaddress);
    st.setInt(3,sponsorsphoneno);
    st.setInt(4,sponsorsfax);
    st.setString(5,refno);
    st.executeUpdate();
         out.println("record updated successfully"+"<A HREF='loginhtml.html'>login page</A>.");
    finally {
         try {
              if (con !=null) {
              con.close();
         catch (SQLException se)
         out.println(se.getMessage());
    %>
    </body>
    </html>
    the database is not updating...its updating when i am giving values directly to update query..why?help me plzzz..
    thanks in advance

    ashish1234 wrote:
    hi,
    I am in the final touch of my course work in jsp.i did all the coding and tested..everything was working properly..after i did some modification in the structure of the page the update query is not working..i dont understand why?
    i am attaching my old page and new page here...plz help me to solve this...
    the database is not updating...its updating when i am giving values directly to update query..why?help me plzzz..With all that Java code in your JSPs, it doesn't look like you are in the final touch of learning JSP, but just at the beginning. Try to move all that java code into Servlets and JavaBeans. The JSP should be all about display, and nothing else.
    What is your problem? I don't know. All that unformatted code is un-readable. On top of being scriptlet code which is hard enough to read.
    You should search the logs to see if there is an error message hidden in there. That is one of the major problems with putting regular Java code in JSPs, the error messages get hidden, and become near impossible to translate.

  • Search in ADF does not work

    Hello.
    I have created a search form with two iterators one for the results and the other for the search criteria. The search form works as expected. The name of the view that i am using is "MasterPartyView1". When i execute the following code
    ViewObject voMasterParty = appMod.findViewObject("MasterPartyView1");
    voMasterParty.setWhereClause("Id = " + MasterPartyId);
    voMasterParty.executeQuery();
    Row rowDest = voMasterParty.first();
    in a backing bean and i go to the search form the only result that i a have is the row that i found in this statement (voMasterParty.setWhereClause("Id = " + MasterPartyId);).
    Why is that?The adf search does not go every time in the database to fetch rows?
    the only workaround for the moment is that i put these two extra lines in the backing bean
    voMasterParty.setWhereClause(null);
    voMasterParty.executeQuery();
    which is not correct because i am fetching all the rows from the database i think.
    Thank you in advance
    Periklis

    Frank thanks a lot for your answer but i still have some questions.
    1 question: One workaround that i found is to the search with the view named MasterPartyView1 and have another instance of the view object(MasterPartyView2) in order to perform the custom search(setwhereclause).This seems to work. Is this approach correct?
    2 question: if i understood correctly you say that both iterators point to the result set of the query (one row) and such is not possible to find other rows. But in the search form there is an invoke action
    <invokeAction id="AlwaysInFindMode" Binds="Find"
    RefreshCondition="${bindings.MasterPartyView1SearchIterator.findMode == false}"/>
    that to my understanding puts the iterator in Find mode, thus making the input text fields available for criteria again. So the search iterator now points to QBE and it is possible to iterate over a collection of QBE criteria rows. is this correct?And if it is why it does not work as expected?Why it does not bring other results?Why the iterators (the seach iterator and the results iterator) still point to the newly created result set?
    Thanks in advance
    Periklis

  • Runtime.exec()  in Java not working in Oracle 10 Application Server

    Hi ,
    I am trying to call a .exe file which is in the Web Application folder .
    I am Using Process p = Runtime.exec("path to .exe file ")
    This code is working fine when used with JBOSS , but not working with Oracle Application server .
    Please tell me whether i need to do any chnages to make it work
    Thanks in advance .

    I ran a quick test with your code, I just had to make some small changes, and things work for me...
    I'm testing with JDeveloper 10g 10.1.3.2.0 ...
    The only thing I wonder is DBUser DBPass DBHost, those are not the actual values, correct?, neither they are environment variables?...
    In the server hosting your OAS, you should try running the whole CMD line from the start/run dialog ... make sure it works in that server ...
    Here is the code used in my test:
    In JSP:
      <%@ page import="runexepkg.*" %>
      <% 
      String msg = "";
      try
      RunEXE p = new RunEXE();
      msg = p.main1();
      catch(Throwable t)
         System.out.println("Exception Raised");
         t.printStackTrace();
      %>
      <%= msg %>In Java Class:
    package runexepkg;
    import java.sql.*;
    public class RunEXE
        String ss="";
        public String main1()
        try
            Runtime rt=Runtime.getRuntime();
            Process p = rt.exec("CMD /C start C:\\oraappserver\\j2ee\\WebGis\\applications\\PowerGis\\web\\WEB-INF\\classes\\GisProject\\cust_data_1.exe DBUser DBPass DBHost");
            System.out.println("Command has been executed");
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@DBHost:DBPort:orcl","DBUser","DBPass");
            System.out.println("Test Connection ========== "+con);
            Statement st = con.createStatement();
            ResultSet rs = st.executeQuery("SELECT SYSDATE FROM DUAL");
            if(rs.next())
                ss="Command has been executed - Database has been accessed";
            else
                ss="Command has been executed - Database was not accessed";
        catch(Throwable t)
            System.out.println("Exception raised, command has NOT been executed");
            ss="Exception raised, command has NOT been executed";
            t.printStackTrace();
        return ss;
    }Edited by: Rodolfo Ferrari on Jul 23, 2009 10:40 PM

Maybe you are looking for