Trouble with passing parameters to a dynamic theme

Hello experts,
I have been wrestling with this for days now, and can't seem to understand what is going on here. I don't think it's difficult to figure out and I'm sure I'm not the only one who has come across this, I just feel like I am missing something.
In a nutshell - I have a predefined theme called TEST_DYNAMIC_THEME_NEW2. Its styling rules are as follow:
<?xml version="1.0" standalone="yes"?>
<styling_rules caching="NONE">
    <rule>
        <features style="C.RED"> select geom, :1 FROM TRACT_CURRENT_GEO </features>
  </rule>
</styling_rules>I am obviously trying to pass a parameter to this theme, representing a column name. Perhaps this is not possible, but I don't know why not.
The error message I'm getting in Firebug is as follows:
<?xml version="1.0" encoding="UTF-8" ?> <oms_error> MAPVIEWER-06009: Error processing an FOI request.
Root cause:SQLException: ORA-01722: invalid number
</oms_error>On the other hand, when I am in mapbuilder and I Preview the theme it works fine. It asks for a parameter value for :1, I give it a column name, and a big red map displays in the Preview screen (this is what I want to see [at least for now]).
Any ideas, folks?
Thank you all very much for your time,
John

jpaiva,
I thought that this might be the case. What I was clearly attempting to do is set up a predefined theme that would reference a specific table, but then the queried column could change based on a bind variable. If I want to continue down this path, perhaps the best solution would be to simply create a dynamic jdbc theme query on the client side.
Thanks!

Similar Messages

  • Issue with passing parameters through Java-JSP in a report with cross tab

    Can anyone tell me, if there's a bug in Java SDK in passing the parameters to a report (rpt file) that has a cross tab in it ?
    I hava report that works perfectly fine
       with ODBC through IDE and also through browser (JSP page)
    (ii)    with JDBC in CR 2011 IDE
    the rpt file has a cross tab and accpts two parameters.
    When I run the JDBC report through JSP the parameters are never considered. The same report works fine when I remove the cross tab and make it a simple report.
    I have posted this to CR SDK forum and have not received any reply. This have become a blocker and because of this our delivery has been postponed. We are left with two choices,
       Re-Write the rpt files not to have cross-tabs - This would take significant effort
    OR
    (ii)  Abandon the crystal solution and try out any other java based solutions available.
    I have given the code here in this forum posting..
    CR 2011 - JDBC Report Issue in passing parameters
    TIA
    DRG
    TIA
    DRG

    Mr.James,
    Thank you for the reply.
    As I stated earlier, we have been using the latest service pack (12) when I generated the log file that is uploaded earlier.
    To confirm this further, I downloaded the complete eclipse bundle from sdn site and reran the rpt files. No change in the behaviour and the bug is reproducible.
    You are right about the parameters, we are using  {?@Direction} is: n(1.0)
    {?@BDate} is: dt(d(1973-01-01),t(00:00:00.453000000)) as parameters in JSP and we get 146 records when we directly execute the stored procedure. The date and the direction parameter values stored in design time are different. '1965-01-01' and Direction 1.
    When we run the JSP page, The parameter that is passed through the JSP page, is displayed correctly on the right top of the report view. But the data that is displayed in cross tab is not corresponding to the date and direction parameter. It corresponds to 1965-01-01 and direction 1 which are saved at design time.
    You can test this by modifying the parameter values in the JSP page that I sent earlier. You will see the displayed data will remain same irrespective of the parameter.
    Further to note, Before each trial run, I modify the parameters in JSP page, build them and redeploy so that caching does not affect the end result.
    This behaviour, we observe on all the reports that have cross-tabs. These reports work perfectly fine when rendered through ODBC-ActiveX viewer and the bug is observable only when ran through Java runtime library. We get this bug on view, export and print functionalities as well.
    Additionally we tested the same in
        With CR version 2008 instead of CR 2011.
    (ii)   Different browsers ranging from IE 7 through 9 and FF 7.
    The complete environment and various softwares that we used for this testing are,
    OS      : XP Latest updates as on Oct 2011.
    App Server: GlassFish Version 3 with Java version 1.6 and build 21
    Database server ; SQL Server 2005. SP 3 - Dev Ed.
    JTds JDBC type 4 driver version - 1.2.5  from source forge.
    Eclipse : Helios along with crystal libraries directly downloaded from SDN site.
    I am uploading the log file that is generated when rendering the rpt for view in IE 8
    Regards
    DRG

  • Issue with passing parameters to an applet?

    Hi,
    I have an apex page which is a popup page. I am passing parameters to the applet and then reading them in from my java code.
    Here is my applet code
    <SCRIPT>
      function getStatus(retStatus) {
        $s("P3_MESSAGE", ''||retStatus||'')
    </SCRIPT>
    <APPLET ARCHIVE="/i/bin/offline_load.zip" CODE="offline_load.class"  STATUSMSG WIDTH=0 HEIGHT=0>
    <PARAM name="username" value="&APP_USER.">
    <PARAM name="dbuser" value="&P3_DBUSER.">
    <PARAM name="dbpassword" value="&P3_DBPASSWORD.">
    <PARAM name="dbserver" value="&P0_DBSERVER.">
    <PARAM name="dbport" value="&P3_DBPORT.">
    <PARAM name="dbsid" value="&P3_DBSID.">
    </APPLET>P3_DBUSER, P3_DBPASSWORD, etc are all defined on page zero as hidden and protected items
    My applet code
    public void init() {
        CallableStatement load_stmt = null;
        String userName = this.getParameter("username");
        String dbUser = this.getParameter("dbuser");
        String dbPass = this.getParameter("dbpassword");
        String dbServer = this.getParameter("dbserver");
        String dbPort = this.getParameter("dbport");
        String dbSid = this.getParameter("dbsid");
        try {
          System.out.println("init(): loading OracleDriver for applet created at " + created.toString());
          Class.forName("oracle.jdbc.driver.OracleDriver");
          System.out.println("init(): getting connection");
          conn = DriverManager.getConnection("jdbc:oracle:thin:@" + dbServer + ":" + dbPort + ":" + dbSid, dbUser, dbPass);
        } // end tryThe odd thing is I have gotten this working twice then unexpectedly it just stops working when I make a change to the java applet code.
    And the changes have absolutely nothing to do with the above code it can be anything the first time was error handling I added
    to another section and the second I modified a stored procedure call.
    Anyone have any idea why this might be occurring as this is driving me completely insane :(
    Thanks in advance

    Hi,
    In your init() code, you have a "try" block - do you have a "finally" block to close the connection? Something like:
    finally {
      try {
        conn.close();
      catch (Exception ignore) {
    }Could it be that you have reached the limit of the number of available open connections?
    Your code looks ok as far as I can see (based on examples at: http://www.orafaq.com/wiki/JDBC )
    Also, in your new bits of code, have you added try/catch/finally blocks? Does the code compile fully (ie, no warnings)? Have you added new imports that may conflict with existing code such that you have to fully qualify existing objects/classes (eg, you may now have two DriverManager classes or CallableStatement objects)?
    Andy

  • Calling procedure with 2 parameters from a dynamic link

    I have just another question-
    I have a procedure testing_del_archive which is being called with 2 parameters...from a dynamic link in my SQL Query.
    The following is my code....
    SELECT re.report_exec_id, re.exec_userid,
    NVL(re.batch_exec_date, re.begin_date) report_date,
    re.rows_returned,
    re.status, re.error,
    f_file_url(re.filename) file_url,
    re.comments,
    ''Archive''archive
    FROM metadev.report_execution re, metadev.report r
    WHERE re.report_id = r.report_id
    AND r.spec_number = :v_spec
    AND re.status <> 'DELETED'
    AND re.exec_userid like (DECODE(:v_user_filter,'ALL','%',:v_user_filter))
    ORDER BY begin_date DESC
    The first parameter is the value in the execution id field and the second argument is hardcoded "Archived"...
    IT GIVES AN ERROR....
    Do you guys know where I am going wrong...

    You missed the ampersand symbol in between the parameters.
    This should be
    ''Archive''archive
    instead of
    ''Archive''archive

  • Issue with passing parameters from JSP to Backing bean

    hi ,
    I have an issue in passing parameters from my JSP to backing bean. I want to fetch the parameter from my URL in backing bean .This is how i am coding it right now. But the parameter companyID returns me null.
    URL http://localhost:8080/admin/compadmin.jsp?companyID=B1234.
    In my backing bean
    FacesContext context = FacesContext.getCurrentInstance();
    String companyID = (String)context.getExternalContext().getRequestParameterMap().get("CompanyID");
         public void setCompanyID(String companyID)
              this.companyID=companyID;
         public String getCompanyID()
              return this.companyID;
    faces-config.xml :
       <managed-bean-name>admincontroller</managed-bean-name>
              <managed-bean-class>com.admin.controller.AdminController</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>companyadminbean</property-name>
                   <property-class>com.admin.model.AdminBean</property-class>
                   <value>#{companyadminbean}</value>
                         </managed-property>
                        <managed-property>
                                 <property-name>companyID</property-name>
                              <value>#{param.companyID}</value>
                             </managed-property>Please let me know if iam missing something.Appreciate your help in advance
    Thanks

    Thanks very much for your input. I made changes to my bean accordingly. Actually the method getAdminType() is a not a getter of a property. It's just a method which iam calling in AdminController bean constructor to verify whether the person is System Admin or Client admin. So now the issue is inspite of making changes still the link "Copy Users" shows up for Client admin too which is incorrect.
    My Administrator bean:
    public class Administrator {
      boolean GSA=false;
      boolean SA=false;
      public Administrator(){}
    public boolean isGSA()
        return GSA;
      public boolean isSA()
        return SA;
      public void setGSA(boolean value)
        this.GSA=value;
      public void setSA(boolean value)
        this.SA=value;
    }My backing bean:
    public class AdminController {
    private AdminBean adminbean = new AdminBean();
    public AdminController(){
    int userID=1234;
    this.getAdminType(userID);           
    public void getAdminType(int userID)
             Administrator admin = new Administrator();
             if (userID<0) return;
             try{
                 if(Rc.isGlobalSystemAdmin(userID)){
                      admin.setGSA(true);
                              }else if(Rc.isClientSystemAdmin(userID)){
                      admin.setSA(true); // i could see these values setup correctly in the admin bean when i print them
                 adminbean.setAdmin(admin);
                  } catch (Exception e){ }
    Admin Bean:
    public class AdminBean {
    private Administrator admin; 
    public Administrator getAdmin()
                        return this.admin;
              public void setAdmin(Administrator admin)
                        this.admin = admin;
    faces-config.xml
    <managed-bean>
              <managed-bean-name>admincontroller</managed-bean-name>
              <managed-bean-class>com.controller.AdminController</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>adminbean</property-name>
                   <property-class>com.model.AdminBean</property-class>
                   <value>#{adminbean}</value>
             </managed-property>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>adminbean</managed-bean-name>
              <managed-bean-class>com.model.AdminBean</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <managed-property>
                   <property-name>admin</property-name>
                   <property-class>com.model.Administrator</property-class>
                   <value>#{admin}</value>
                             </managed-property>
         </managed-bean>     My JSP:<h:outputLink id="ol1" value="/companyadmin/copyusers.jsp">
               <h:outputText id="ot1" value="Copy Users" rendered="#{adminbean.admin.isGSA}" /><f:verbatim><br/></f:verbatim>
               </h:outputLink>    so now the issue is thelink copy users is displayed even #{adminbean.admin.isGSA} is FALSE. please advise.
    Thanks
    Edited by: twisai on Oct 15, 2009 7:06 AM

  • Help with passing parameters to Aspell from C [SOLVED ENOUGH]

    I found this really cool utility called aspellstdout that will allow for rudimentary spell check in Scite:
    http://www.distasis.com/cpp/scitetip.htm#spell
    What I can't figure out (and the author didn't either) is how to pass parameters beyond language to Aspell. What I want to be able to do is pass mode switches. For instance, if I have a LaTeX document I want to be able to pass the -t switch (--mode=tex). I looked through aspell.h and couldn't see what I'm looking for.
    --EDIT--
    The output to xterm option is far easier and it makes quite a bit more sense now that I'm use to it. From my .SciTEUser.properties:
    # Rudimentary LaTeX Spell Checker
    command.name.2.$(file.patterns.tex)=Spell Check
    command.2.$(file.patterns.tex)=xterm -e aspell -t -c $(FileNameExt)
    command.subsystem.2.$(file.patterns.tex)=0
    Last edited by skottish (2008-09-08 01:58:57)

    Hi,
    I see you're using System.Data.OracleClient (which has been deprecated by MS) rather than Oracle.DataAccess.Client, but this works for me with Oracle's ODP, maybe it will help.
    Cheers,
    Greg
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class dataadapterfill
        public static void Main()
            using(OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl"))
                con.Open();
                using(OracleCommand cmd = new OracleCommand("select ename from emp where ename = :1", con))
                    cmd.Parameters.Add(new OracleParameter("myename", OracleDbType.Varchar2, 50)).Value = "KING";
                    OracleDataAdapter da = new OracleDataAdapter(cmd);
                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    foreach (DataRow row in ds.Tables[0].Rows)
                        Console.WriteLine("ename: {0}", row["ename"]);
    }

  • Pass parameters to a dynamic page with MULTIPART

    Hello everybody,
    I'm facing with a problem that I still can't resolve...
    For some reasons I need to use a Dynamic Page as a form, so I create an html form (which contains also an <input type="file" name="file_test">) that call the same page with enctype="multipart/form-data".
    When I call the page to save the data, I can read all the parameters with :parameter_name, but I can't read the content of the file. If I try to get :file_test it contains only a file name.
    How I can get:
    1) the mime format
    2) the content of the file (binary)
    and then save it in a blob?
    Thank you in advance for your help...

    You can use sessions to pass values from one page to another.
    In page A you can add a value:
    v_user_session portal.wwsto_api_session;
    v_user_session := portal.wwsto_api_session.load_session(
    p_domain => 'yourDomain',
    p_sub_domain => 'sub');
    v_user_session.set_attribute(
    p_name =>'name',
    p_value => 'YourValue'
    v_user_session.save_session;
    The p_domain and p_sub_domain can be choosen freely but you must know that they have to be the same if you want the retrieve the value from page2:
    v_user_session portal.wwsto_api_session;
    v_user_session := portal.wwsto_api_session.load_session(
    p_domain => 'yourDomain',
    p_sub_domain => 'sub');
    yourValue := v_user_session.get_attribute_as_varchar2('name');
    This is how you can pass values without posting or without adding them to the URL.

  • Crystal Report - problem with passing parameters from J2EE app

    i'm trying to pass a few parameters from my java application to a crystal report using the code below:
    ParameterField pfield1 = new ParameterField();
    ParameterField pfield2 = new ParameterField();
    Values vals1 = new Values();
    Values vals2 = new Values();
    ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();
    ParameterFieldDiscreteValue pfieldDV2 = new ParameterFieldDiscreteValue();
    pfieldDV1.setValue("1056");//dform.getSelectedPeriod());
    pfieldDV1.setDescription("termId");
    vals1.add(pfieldDV1);
    pfield1.setReportName("");
    pfield1.setName("@p_termId");
    pfield1.setCurrentValues(vals1);
    fields.add(pfield1);
    // check here for null condition otherwise will throw nullpointerexception
    pfieldDV2.setValue("elect");
    pfieldDV2.setDescription("allocType");
    vals2.add(pfieldDV2);
    pfield2.setReportName("");
    pfield2.setName("@p_allocType");
    pfield2.setCurrentValues(vals2);
    fields.add(pfield2);
    this report calls a stored procedure (sql server). the report displays the data but the same is not the case when i call ity from my java application. with a single parameter it works fine (even though i get a "Some parameters are missing values" ERROR on the console. But when i pass, say 2 parameters, it give me the above error first and then "JDBC Error: Parameter 2 not set or registered for output"
    Can anyone bail me out of this one?
    thanks,
    ptalkad

    I don't know about naming conventions, but could the @ signs in the variable names cause a problem?
    How have you set up the mapping in Crystal?
    Is this parameter 2 an "out" parameter returning a value?
    What version of Java are you using?
    Version of Crystal?
    What JDBC driver?

  • Help needed with passing parameters

    Hi,
    I'm using a PL/SQL API to insert values into the base tables. When i press the button 'Create Task' this API should be invoked. But i should be passing table type as parameters to the API. How do i write a code to implement this?
    Is there any wrapper that i have to write?
    Thanks

    Hi,
    Follow the steps in order
    1) Create a global type of the table type in oracle which you would pass to oracle
    Ex : Create type <typename> as object (field1 datatype,..... )
    say you have given typename as ROWTYPE
    Create type <typename> as table of <above Object>
    say you have given typename as TABTYPE
    2) Check this
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.OADBTransactionImpl;
    import java.sql.Connection;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    OADBTransactionImpl dbtranst = (OADBTransactionImpl)am.getOADBTransaction();
    Connection conn = dbtranst.getJdbcConnection();
    try
    //Declaring the structure and table type
    StructDescriptor voRowStruct = StructDescriptor.createDescriptor("ROWTYPE",conn);
    ArrayDescriptor arrydesc = ArrayDescriptor.createDescriptor("TABTYPE",conn);
    //Filling the rowtype and table type with values
    if((vo != null) && (vo.isExecuted()))
    Row row[] = vo.getFilteredRows("SelectBox","Y");
    Object[] attrib = new Object[7];
    String empNum = null;
    String firstName = null;
    String lastName = null;
    String fullName = null;
    String emailAddress = null;
    String managerId = null;
    String positionCode = null;
    String salary = null;
    String startdate = null;
    String endDate = null;
    String createdBy = null;
    String creationDate = null;
    String lastUpdateDate = null;
    String lastUpdateLogin = null;
    STRUCT[] loadedStruct = new STRUCT[row.length];
    if(row.length > 0)
    // throw new OAException("More the one check box selected", OAException.INFORMATION);
    // String [] empName = new String[row.length];
    for (int i = 0; i < row.length; i++)
    // empName[i] = row.getAttribute("EmployeeName").toString();
    empNum = row[i].getAttribute("EmployeeId").toString();
    firstName = row[i].getAttribute("EmployeeName").toString();
    lastName = (String)row[i].getAttribute("EmployeeEmail");
    managerId = row[i].getAttribute("ManagerId").toString();
    positionCode = (String)row[i].getAttribute("PositionDisplay");
    attrib[0] = empNum;
    attrib[1] = firstName;
    attrib[2] = lastName;
    attrib[3] = fullName;
    attrib[4] = emailAddress;
    attrib[5] = managerId;
    attrib[6] = positionCode;
    /* attrib[7] = salary;
    attrib[8] = startdate;
    attrib[9] = endDate;
    attrib[10] = createdBy;
    attrib[11] = creationDate;
    attrib[12] = lastUpdateDate;
    attrib[13] = lastUpdateLogin; */
    loadedStruct[i] = new STRUCT(voRowStruct, conn, attrib);
    3) Here is the code to call package.procedure with the above arrays
    ARRAY myarray = new ARRAY(arrydesc,conn, loadedStruct);
    StringBuffer sqlstmt = new StringBuffer(200);
    sqlstmt.append("BEGIN");
    sqlstmt.append(" myproc( ");
    sqlstmt.append("p_mytab => :1 );");
    sqlstmt.append(" END;");
    OracleCallableStatement callStmt = (OracleCallableStatement)dbtranst.createCallableStatement(sqlstmt.toString(),0);
    callStmt.setARRAY(1,myarray);
    callStmt.execute();
    } catch(Exception e)
    System.out.println("Exception "+e.getMessage());
    throw new OAException(e.getMessage());
    My code may be very raw as its early days for me in jDev... but i think it shall give you some idea ...
    Thanks
    Tom...

  • Help with passing parameters from a servlet to an applet

    dear all
    i m working on a application which will check weather a file is present in a server (webserver) if it is present then it will take the file name and put it into a drop down list and there is a button on click of which i m taking the call to an applet and then on that i need the file name if it is there then i use it to draw a graph
    i m struck on how to take parameter from Servlet -> Applet
    thanks
    Nakul

    hi,
    I understood your question,The context "servlet" cannot communicate to
    an applet becoz applet runs at clients browswer, rather you can communicate from an applet to servlet(HTTPURLCONNECTION class).
    Well coming to the problem, this is how i have understood your problem,
    basically uou get the list of files from the server using normal servelt programing and you will display in an html LIst box and then click the button to view the graph or chart ,
    then you just want to pass the filename which is there in the listbox to an applet and applet will display some image.
    As we know all that using <PARAM NAME=XX VALUE=YY> WE CAN GET THE VALUE IN APPLET BY USING GETPARAMTER() METHOD. and Im very sure that you are not asking that question. your question is like " both the applets and
    the listboxes will be loaded at once and when he selects one of the file from the list box then without refreshing the page , how to display the graph.
    Im i right?
    If so i guess you have to use javascript to do that stuff, and i think its like gave an id for the tag shown <applet id="yes">
    then in the javascript , you can call the Java applet methods (I have never tried before but seen some demos(i dont have that links- google it for inf))
    but i can give clue like.. trying the <PARAM VALUE=""> IF POSSIBLE
    CHAING THE HTML CONTENT IS POSSIBLE IN IE which is again through javascript by calling yes.innerHTML="<PARAM><PARAM><PARAM><PARAM>..."
    Im sure that you can call Java methods from javascript but i never tried and even you can pass an arguments to it.. Let me check out like
    becoz even im interested to know abt it
    bye
    with Regars
    Lokesh T.C

  • Probelem with passing parameters to function module

    hey i am facing a problem to pass the parameters to function module.let me explain.. we cant pass the parameters which we are using in the select option statements directly to a function module called...i just wanna know if there is any way so that i can pass those values to a fnc module while passing it from select options

    Hi,
    You have to create a table type in SE11..
    Check this sample table type PDSMAINT_MATNR_RNG_T...
    Then use that table type in the importing parameter of FM..
    PT_MATNR TYPE PDSMAINT_MATNR_RNG_T..
    For which field you have created select-options..I will check if there is any existing table type in se11..
    Thanks,
    Naren

  • Problems with passing parameters for WEB template in URL in NW2004s

    Servus,
    We have NW2004s, BI 7.0, SP9
    does anybody know where do I make a mistake? There are 9 variables which the user has to fill out.
    Passing the parameters in URL string for a web template like: http://server:50100/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=TEMPLATENAME&var_name_1=ZvarX&var_value_ext_1=2000 ....
    but this doesn't function, I get only the first variable screen and not what's set in my URL.
    Is it a bug? Any suggestions?
    Thank you very much
    Standa

    I solved it.
    Solution:
    URL Link "http://......./TEMPLATE=nameofthepage&TEMPLATE=nameofthepage
    &VARIABLE_VARIANT=nameofthevariant"

  • Problem with passing parameters from HTML

    Im unsure as to where to turn next with this problem. What is making it all the more infuriating is that I have had this code working previously and now cant for the life of me figure out how I did it.
    What Im trying to do is I have a HTML page with two buttons on, one called "Submit Application" and the other "Submit Resource" and when I click on one I want a JSP page to be called and a certain piece of SQL to be executed, likewise when I click on the other "Submit Application" button I want a separate bit of SQL to be executed. (I know in this example both bits of SQL are identical but that is just while I get the functionality correct).
    Whats happening is that the first bit of SQL will execute if I click the "Submit Resource" button, however when I click the "Submit Application"
    button I get a "Error 500:" displayed. Im at the end of my tether as to what to do next and as I say it makes it all the more infuriating in that I had it working before. So any help would be greatly appriciated.
    The code is as follows, I have highlighted the two IF statements :-
    <HTML>
    <FORM>
    <BODY>
    <%@ page import="java.util.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ page import="javax.naming.*" %>
    <HTML>
    <HEAD>
    <TITLE>Resource Level Report</TITLE>
    <table width="200" border="1" align="center">
    <tr>
    <th scope="row"><img src="color_teradata_logo.gif"> </th>
    <td></td>
    <td><img src="lloydslogo.gif"></td>
    </tr>
    </table>
    <br>
    </HEAD>
    <BODY leftmargin=0 topmargin=0 marginwidth="0" marginheight="0">
    <%
    String dbURL="jdbc:oracle:thin:@lloyds.unitedkingdom.ncr.com:1521:smacdev";
    String dbUSER="agents";
    String dbPW="smac_us";
    String Resrce = request.getParameter("Resrce"); String Appln = request.getParameter("app"); String Subres = request.getParameter("Submit Resource"); String Subapp = request.getParameter("Submit Application"); Connection con = null;
    if (!Subres.equals (null)) {
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(dbURL, dbUSER, dbPW); } catch(SQLException e) { System.err.println("Failure to connect " + e.getMessage()); }
    if (!Subres.equals (null)) {
    try
    String sqlstring = "Select app.application, res.resorce, res.system, res.status, res.unitofworkname, res.unitofworkvalue, res.capturetimestamp from agents.Resorce res, agents.applicationresource app where res.resorce = app.resorce and res.system = app.system and upper(res.resorce) = upper('"+ Resrce + "') order by 3";
    //out.println(sqlstring);
    //out.println(Subapp);
    //out.println(Subres);
    //commented this out, but enable you to see SQL that is been executed !!!
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery(sqlstring);
    int count =0;
    %>
    <table width ="380" border="0" align="center">
    <h1 align="center">Resource Level Reporting</h1>
    </table>
    <br>
    <table width="200" border="6" align="center" >
    <th bgcolor="#FF9933">System<th bgcolor="#FF9933">Resource<th
    bgcolor="#FF9933">Application<th bgcolor="#FF9933">Unit Of Work Name<th
    bgcolor="#FF9933">Timestamp <th bgcolor="#FF9933">Unit Of Work Value<th
    bgcolor="#FF9933">Status<tr>
    <%
    while (res.next()){
    String app= res.getString(1);
    String resorce = res.getString(2);
    String system = res.getString(3);
    String status = res.getString(4);
    String unitofworkname = res.getString(5);
    String unitofworkvalue = res.getString(6);
    String capturetimestamp = res.getString(7);
    String timestampmod = capturetimestamp.substring (0,19);
    String status1 = status.trim();%>
    <% if (status1.equals ("SYNC")) { %>
    <tr>
    <td bgcolor="#00FF33">
    <%out.print(system);%>
    <td bgcolor="#00FF33">
    <%out.print(resorce);%>
    <td bgcolor="#00FF33">
    <%out.print(app);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkname);%>
    <td bgcolor="#00FF33">
    <%out.print(timestampmod);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="#00FF33">
    <%out.print(status);%>
    <% }
    else if (status1.equals ("OOS")) { %>
    <tr>
    <td bgcolor="red">
    <%out.print(system);%>
    <td bgcolor="red">
    <%out.print(resorce);%>
    <td bgcolor="red">
    <%out.print(app);%>
    <td bgcolor="red">
    <%out.print(unitofworkname);%>
    <td bgcolor="red">
    <%out.print(timestampmod);%>
    <td bgcolor="red">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="red">
    <%out.print(status);}%>
    <%
    res.close();
    stmt.close();%>
    <tr>
    </table>
    <%
    catch (SQLException e) {
    out.println("Sql error here " + e.getMessage());
    finally {
    con.close();
    %>
    <%
    if (!Subapp.equals (null)) {
    try
    String sqlstring = "Select app.application, res.resorce, res.system,
    res.status, res.unitofworkname, res.unitofworkvalue, res.capturetimestamp
    from agents.Resorce res, agents.applicationresource app where res.resorce =
    app.resorce and res.system = app.system and upper(res.resorce) = upper('"+
    Resrce + "') order by 3";
    //out.println(sqlstring);
    //out.println(Subapp);
    //out.println(Subres);
    //commented this out, but enable you to see SQL that is been executed !!!
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery(sqlstring);
    int count =0;
    %>
    <table width ="380" border="0" align="center">
    <h1 align="center">Resource Level Reporting</h1>
    </table>
    <br>
    <table width="200" border="6" align="center" >
    <th bgcolor="#FF9933">System<th bgcolor="#FF9933">Resource<th
    bgcolor="#FF9933">Application<th bgcolor="#FF9933">Unit Of Work Name<th
    bgcolor="#FF9933">Timestamp <th bgcolor="#FF9933">Unit Of Work Value<th
    bgcolor="#FF9933">Status<tr>
    <%
    while (res.next()){
    String app= res.getString(1);
    String resorce = res.getString(2);
    String system = res.getString(3);
    String status = res.getString(4);
    String unitofworkname = res.getString(5);
    String unitofworkvalue = res.getString(6);
    String capturetimestamp = res.getString(7);
    String timestampmod = capturetimestamp.substring (0,19);
    String status1 = status.trim();%>
    <% if (status1.equals ("SYNC")) { %>
    <tr>
    <td bgcolor="#00FF33">
    <%out.print(system);%>
    <td bgcolor="#00FF33">
    <%out.print(resorce);%>
    <td bgcolor="#00FF33">
    <%out.print(app);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkname);%>
    <td bgcolor="#00FF33">
    <%out.print(timestampmod);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="#00FF33">
    <%out.print(status);%>
    <% }
    else if (status1.equals ("OOS")) { %>
    <tr>
    <td bgcolor="red">
    <%out.print(system);%>
    <td bgcolor="red">
    <%out.print(resorce);%>
    <td bgcolor="red">
    <%out.print(app);%>
    <td bgcolor="red">
    <%out.print(unitofworkname);%>
    <td bgcolor="red">
    <%out.print(timestampmod);%>
    <td bgcolor="red">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="red">
    <%out.print(status);}%>
    <%
    res.close();
    stmt.close();%>
    <tr>
    </table>
    <%
    catch (SQLException e) {
    out.println("Sql error here " + e.getMessage());
    finally {
    con.close();
    %>
    </BODY>
    </FORM>
    </HTML>
    I think the error messages I am getting are :-
    [15/09/04 12:38:36:535 BST] 45b5f97b WebGroup I SRVE0180I: [SMAC Web Front End] [smac] [Servlet.LOG]: /JSP/Resreports.jsp: init
    [15/09/04 12:39:08:510 BST] 7abd7978 WebGroup I SRVE0180I: [SMAC Web Front End] [smac] [Servlet.LOG]: /JSP/Resreports.jsp: init
    [15/09/04 12:39:15:273 BST] 7abd7978 WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
         at org.apache.jsp._Resreports._jspService(_Resreports.java:117)
         at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java(Compiled Code))
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java(Compiled Code))
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code))
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))

    You make your comparisons like this:
    if (!Subapp.equals (null))
    Well, what happens if Subapp IS equal to null. The .equals method call will be called from a NULL and you will get a NullPointerException.
    When testing for null you do:
    if (Subapp == null) (or if (Subapp != null)
    This is okay when dealing objects even with the mantra of 'don't use == to compare objects, because what you are really testing is if the reference points anywhere, and == will compare the reference.
    Also, next time you post, make sure to use the [code] tags as described in the [Formatting Help] link. It will make it easier to read.
    Also, you should try to remove the SQL from the JSP. Move it into a Servlet which builds a List that forwards to another JSP for display, or use a bean. Using java classes like Servlets and JavaBeans makes it easier to debug, and makes your JSP code easier to manage.

  • JDBC ojdbc6.jar problem with passing parameters for PreparedStatements.

    The JDBC Driver being used in ojdbc6.jar. I am using this driver because I of its compatibility with Java 6 which is on my machine
    The database I am connecting to is 10.2 (10g) Oracle database.
    The connection works fine its the parsing of the SQL query that is giving the problem Below is the code specific to this
    // never mind the syntax this is a JavaFX module and the query syntax doesn't use the '+' concats.
    sql = "select sfrracl_pidm,\n"
    " sfrracl_term_code, \n"
    " sfrracl_source_cde, \n"
    " sfrracl_reg_access_id \n"
    "from SFRRACL \n"
    "where sfrracl_term_code=? \n"
    "and sfrracl_pidm =\n"
    " (select spriden_pidm from spriden\n"
    " where spriden_id=? \n"
    " and spriden_id like 'G%'\n"
    " and spriden_change_ind is NULL);";
    //stmt = conn.createStatement(sql);
    try{
    ps = conn.prepareStatement(sql);
    ps.setString(1, stud_id);
    ps.setString(2, term_code);
    catch(fr:SQLException)
    fr.printStackTrace();
    try{
    //ps.executeUpdate();
    System.out.print('Student ID: ');
    System.out.println(stud_id);
    System.out.print('Term Code: ');
    System.out.println(term_code);
    System.out.println(sql);
    ps.executeQuery(); // error occurs here
    The output and exception thats thrown is below
    //debug output
    Student ID: GXXXXXXXX
    Term Code: 201020
    //sql statement thats in string
    select sfrracl_pidm,
    sfrracl_term_code,
    sfrracl_source_cde,
    sfrracl_reg_access_id
    from SFRRACL
    where sfrracl_term_code=?
    and sfrracl_pidm =
    (select spriden_pidm from spriden
    where spriden_id=?
    and spriden_id like 'G%'
    and spriden_change_ind is NULL);
    // end debug output
    java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
    at sfrracl.Main.buttonOnMouseClicked(Main.fx:215)
    at sfrracl.Main.buttonOnMouseClicked(Main.fx:215)
    at sfrracl.Main.invoke$(Main.fx:117)
    at sfrracl.Main.invoke$(Main.fx:117)
    at com.sun.javafx.functions.Function1.invoke(Function1.java:44)
    at com.sun.javafx.functions.Function1.invoke$(Function1.java:38)
    at javafx.scene.Node.impl_processMouseEvent(Node.fx:2917)
    at javafx.scene.Node.preprocessMouseEvent(Node.fx:2946)
    at javafx.scene.Scene$MouseHandler.process(Scene.fx:1499)
    at javafx.scene.Scene$MouseHandler.process(Scene.fx:1361)
    at javafx.scene.Scene.impl_processMouseEvent(Scene.fx:679)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.fx:956)
    at com.sun.javafx.tk.swing.SwingScene$SwingScenePanel.doMouseEvent(SwingScene.java:446)
    at com.sun.javafx.tk.swing.SwingScene$SwingScenePanel.mouseClicked(SwingScene.java:454)
    at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    BUILD FAILED (total time: 31 seconds)
    The invalid character that this is claiming are the ? marks however that would mean my setString
    is not working I am following what the documentation says why is this?

    http://forums.oracle.com/forums/forum.jspa?forumID=99 is the JDBC forum

  • Trouble with passing values into table !

    Well my problem seems to be very small but have tried a lot of books and e-books to get a possible solution, but all in vain.
    The problem is I have a table, lets say 'tab', which has a varchar2 column, lets say 'col'.
    I want to be able to make an insert into this 'col' column of the table 'tab'.
    Simple inserts with all symbols work fine. But when I run the following insert, it fails.....
    insert into tab
    values('abcn&def');
    Assume the table tab has a single column 'col' of varchar2 datatype. When I run the insert statement it prompts a value. Is there anyway I can store '&' as a part of the data?

    In SQL*Plus ampersand character (&) is the default character to identify a parameter.
    Either use set define off or set define to a different character.
    SQL > set define off
    --- this will turn off & as the input parameter definition charatcer
    or use
    SQL > set define *
    -- this will set * as the input parameter definition charatcer instead of &
    Shakti
    (http://www.impact-sol.com)
    (Developers of Guggi Oracle)

Maybe you are looking for

  • Getting runtime error SAPSQL_ARRAY_INSERT_DUPREC In production

    Hi, can somebody help me regarding below issue.i am abaper. During SAP technical monitoring it has been noticed that there are many System dumps SAPSQL_ARRAY_INSERT_DUPREC other terms in the dump file are SALLZED7, LZED7F01, and UPDATE_TORGUE_TABLE.

  • Help with Accordion Appearance

    I have created a pertty neat accordion on my website. See below.  But I have one issue.  When I expand it where is visible gaps between the buttons.  When I expand the Accordion there is negitive space between the sections. (see pictures below)  I cr

  • HDV 720p60 VS HDV 720p30??

    This one should be easy but I have forgotten what all of those numbers mean. I noticed that when I try to use media manager to recompress a project using HDV 720p60 the project size ends up being half the size of the project if I were to use HDV 720p

  • How to serialize a binary tree object

    HI Friends, This is the problem............................. I got a binary Tree Program with root (object ) containing the elements in the tree. I got a server which performs insertions and deletions in the root. Once it has got the operations right

  • How to delete source system (popup window)

    Hi All, I want to delete the source system RSA1 - Source Systems - system and Delete but for every using "Transfer structure" i receive the popup information window and i have to confirm this window. It takes much time. Do you know anybody the anothe