Simple exception chaining problem

The problem is 'throw new ClientException(e.getMessage());' the error message kept stating to be in try/catch but it's already in try bracklet. I tried placing the exception in other bracklet but it defeats the purpose of showing the exception in this specific bracklet. I'm not sure what's the solution of this, I got the two solutions in netbeans - make a new try/catch or extending the exception. I looked at the book, I don't see this class extending anything.
import java.sql.Connection;
import java.sql.SQLException;
public class ClientBO {
    private Connection con;
    /** Creates a new instance of ClientBO */
    public ClientBO() {
        con = TomcatDAOFactory.createConnection();
    public void addSheet(SheetsForm sheetsform) {
        Connection con = null;
        try {
            TomcatClientDAO tomcatclientdao = new TomcatClientDAO(con);
            tomcatclientdao.createTest(sheetsform);
            con.commit();
        } catch (Exception e) {
            try {
                if (con != null) {
                    con.rollback();
                    throw new ClientException(e.getMessage());
            } catch (SQLException sqle) {
                e.printStackTrace();
                throw new RuntimeException("error.unexpected");
        } finally {
            try {
                if (con != null) {
                    con.close();
            } catch (SQLException sqle) {
                sqle.printStackTrace();
                throw new RuntimeException("error.unexpected");
}

You declare this:
private Connection con;
and define it in this constructor.
public ClientBO()
Next you declare this:
Connection con = null;
every line below this statement uses this locally defined variable 'conn',
not the class variable 'conn' declared in 'private Connection con' (got that?). So from that point on , conn is null.
Also, see my example on:
http://forum.java.sun.com/thread.jspa?threadID=5193839&messageID=9769059#9769059

Similar Messages

  • Exception Handling Problem In BPM

    All
    I am facing an exception handling problem I am using BPM and , I have caught exception in the transformation step but when there is any data problem in that mapping(mentioned in the transformation)
    it is not throwing the exception . is there any option to collect these type of system exception in  the bpm and give a alert thru mail
    is there any way to collect these type of exception happened in the BPE and raise alert thru generic alert
    Thanks
    Jayaraman

    Hi Jayaraman,
        When you say there is any data problem, does that fail the message mapping that you have defined?
    If the message mapping used in the tranformation fails, it should raise an exception in the BPM.
    Did you test the message mapping using the payload and see if it really fails or not?
    Regards,
    Ravi Kanth Talagana

  • Process chains problems : Working every day with error (red)

    Hi All,
    I have a next question, about process chains problem.
    When I start my process chains immediate, then working without errors,  but I want this process chains work every day and chainged properties, selected date/time and periodicaly (every day) but now it work with error.
    How to I find problems? What are yours offers?
    p.s. I see logs, but every day have diffence between errors.
    Regards,
    Mahir M. Quluzade

    HI,
    just check the time which you have given is OK or is overlappintg with some other job which is locking your table in process chain
    or is colliding with attribute change run
    or it fails because of lack of background processes.
    There could be numerious reasons and you need to analyze the log for this.
    But as you said the job is failing everday for different reasons..try to find the most common errors and try to remove it or mention that here.
    Thanks
    Ajeet

  • Servlet chaining problem..

    import java.io.*;
        import javax.servlet.*;
        import javax.servlet.http.*;
        public class Deblink extends HttpServlet {
          public void doGet(HttpServletRequest req, HttpServletResponse res)
                                       throws ServletException, IOException {
            String contentType = req.getContentType();  // get the incoming type
            if (contentType == null) return;  // nothing incoming, nothing to do
            res.setContentType(contentType);  // set outgoing type to be incoming type
            PrintWriter out = res.getWriter();
            BufferedReader in = req.getReader();
            String line = null;
            while ((line = in.readLine()) != null) {
              line = replace(line, "<BLINK>", "");
              line = replace(line, "</BLINK>", "");
              out.println(line);
          public void doPost(HttpServletRequest req, HttpServletResponse res)
                                        throws ServletException, IOException {
            doGet(req, res);
          private String replace(String line, String oldString, String newString) {
            int index = 0;
            while ((index = line.indexOf(oldString, index)) >= 0) {
              // Replace the old string with the new string (inefficiently)
              line = line.substring(0, index) +
                     newString +
                     line.substring(index + oldString.length());
              index += newString.length();
            return line;
    What is pre request fo above code to work.
    I had tried this many time but it is not working, what will be calling servlet look like

    And can you explain why your title is "Servlet chaining problem"?

  • Com.sap.caf.mp.base.exception.EngineException: Problem in server response:

    Hi,
    I have created one CAF application,which is having one external webservice and one application service.Webservice takes two input parameters(string,boolean) and it returns an arraylist.
    So when i test the CAF application on the CAF service browser it is giving me error like " com.sap.caf.mp.base.exception.EngineException: Problem in server response: [Bad Request]."
    I am getting this error while creating object of web service.
    Can anybody help me on this issue..
    Thanks in Advance

    It looks like you are not authorized to execute the webservice. Check the webservice authentication settings.
    Peter

  • SIMPLE Database Design Problem !

    Mapping is a big problem for many complex applications.
    So what happens if we put all the tables into one table called ENTITY?
    I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
    Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
    Definition of the table
    ENTITY
    EntityID > uniqueidentifier
    EntityType > Tells the entityTypeName
    Name >
    LastName >
    CompanyName > 300 attributeTypes
    OppurtunityPeriod >
    PS:There is also another table called RELATION that points the relations between entities.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    check the coloumn with WHERE _entityType='PERSON'
    as there is is clustered index on entityType...there
    is NO performance decrease.
    there is also a clustered index on RELATION table on
    relationType
    when we say WHERE _entityType ='PERSON' or
    WHERE relationType='CONTACTMECHANISM'.
    it scans the clustered index first.it acts like a
    table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
    WHERE _entityType ='PERSON'
      AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Have you ever thought of using constraints in your
    modell? How would you realize those?
    ...in fact we did.We have arranged the generic object
    model in an object database.The knowledge information
    is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
    But the data schema is held in the RDBMS with code
    generation that creates a schema to hold data.If you think that this approach makes sense, why not.
    But in able to have a efficent mapping and a good
    performance we have thought about building only one
    table.The problem is we know we are losing some space
    but the thing is harddisk is much cheaper than RAM
    and CPU.So our trade off concerated on the storage
    cost.But I still wonder if there is a point that I
    have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
    PS: it is not wise effective using generic object
    models also in object databases as CPU cost is a lot
    when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
    PS2: RDBMS is a value based system where object
    databases are identity based.we are trying to be in
    the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
    What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
    C.

  • Proces chain problem in production

    Hello friends,
    i have faced the process chain problem in the production as "Status change of process ZD_BDIT_ACTIVATE" save status and trigge event if appropiate ? . and displayed message is " ABAP/4 Processor :DBIF_DSQL2_DEFAULT_CR_ERROR" . i want help to solved this problem and what exactly the problem is?
    actually this problem came to activation and its indicated red but when i went to data target and then i show that activation is not started or not trigger. please give me what is exactly problem and what is the proper solution.
    please reply me as soon as possible.

    Quick Checks:
    1. Check the status of User in R/3 which you have used in the RFC destination i.e SM59 and IDOC Adapter ? if it is locked , then unlock it. If password is the problem, then try to change the password.
    Don't reset it ...
    2. Also check out the status in XI, SM59... what is the user used ? is it correct etc... by testing the connection
    3. I think the IDOC Metadata is having problem.. Go to IDX2 and reimport the metadata in XI.
    Also note that, it is prefer to use Service User in SM59, and IDOC adapter instead of dialog use in the Production environment. so that no problem of locking etc
    Hope this helps`
    Rgds Moorthy

  • Exception chaining

    Hello,
    To my surprise in JDK 1.4.1_02 some exceptions like
    IllegalArgumentException, IllegalStateException
    do not support constructors for exception chaining,
    e.g. IllegalStateException(Throwable cause)
    The method Throwable.initCause(Throwable)
    however allows the setting of the cause.
    The result is ugly code if I want to set the cause:
    instead of
    throw new new IllegalStateException(theCause);
    I must write:
    IllegalStateException ex = new IllegalStateException();
    ex.initCause(theCause);
    throw ex;
    Or is this omission of constructors on purpose for some reason?

    Another alternative is to subclass IllegalStateException and call initCause in the constructor:
      public class MyIllegalStateException extends IllegalStateException {
        public MyIllegalStateException(Throwable e) {
          initCause(e);
      }Then you just do the following:
      throw new MyIllegalStateException(e);

  • Process Chains Problem

    Hi,
    I’m facing a problem with the triggering to the Process Chains.
    When I’m creating a new process chain and scheduling it for immediate run using ‘Activate & Schedule’ (F8) the chains fails to start.
    In SM37 I can see the following status for
    BI_PROCESS_TRIGGER in the job log:
      Job started
      Step 001 started (program RSPROCESS, variant XXXXX,
      user ID ALEREMOTE)
    The RSPROCESS variant is correct with WAIT = 0 & TYPE = TRIGGER
    The status of BI_PROCESS_TRIGGER remains ACTIVE & it seems to continue to infinity. The process never seems to continue beyond this point.
    This problem happens only to the newly built chains, existing chains in the system are working fine.
    A similar problem exists with Meta chains.
    I’ve a existing chain to which I’ve attached a new chain as ‘Local Process Chain’. The main chain is scheduled for immediate run & the local chain as Start using Meta Chain or API’
    When I run the main chain (F8) it executes fine but as it enters the local chain it seems to hang. (The other branches of the main chain run to completion).
    SM37 shows the following status for the local chain:
    BI_PROCESS_CHAIN as Active 
    BI_PROCESS_TRIGGER as Active  (Job log shows 'Job Started' and no further info)
    The Job log for BI_PROCESS_CHAIN shows the following:
    Job started
    Step 001 started (program RSPROCESS, variant &0000000007829, user ID ALEREMOTE)
    Communication buffer deleted from previous run 3YD14KALESRSTNM5MHPQ9Z5OW (status X)
    Version 'M' of chain SP_VENDOR_EVAL_INIT was saved without checking
    Version 'A' of chain SP_VENDOR_EVAL_INIT was saved without checking
    The Chain Was Removed From Scheduling
    Program RSPROCESS successfully scheduled as job BI_PROCESS_DROPINDEX with ID 07460801
    Program RSPROCESS successfully scheduled as job BI_PROCESS_INDEX with ID 07460801
    Program RSPROCESS successfully scheduled as job BI_PROCESS_LOADING with ID 07460801
    Program RSPROCESS successfully scheduled as job BI_PROCESS_LOADING with ID 07460901
    Program RSPROCESS successfully scheduled as job BI_PROCESS_ODSACTIVAT with ID 07460901
    Chain  <local chain> Was Activated And Scheduled
    (The  <local chain> has variants for deleting & recreating InfoCube Indexes, loading data to Cube & ODS, and activating ODS )
    It seems the Trigger process of the local chain never completes and so the local chain never runs.
    Any help to solve this issue will be greatly appreciated. I closed & reopened the transaction & even logged out of saplogon & logged in again. But these steps don’t seem to help much! Except that in my second case mentioned above the status in SM37 showed only BI_PROCESS_CHAIN  as Active initially ( without the job BI_PROCESS_TRIGGER ) and after I did my logout & login the BI_PROCESS_TRIGGER  seems to have started. But nothing more than that so far!!
    Thanks in advance,
    Melwyn

    Hi All,
    The problem is resolved by deleting the lock in SM37.
    The following lock appears (and stays!) when the chain is triggered-
    ALEREMOTE <time> E RSPCLOGCHA <chain name> #########################
    The lock is released if you leave the RSPC transaction & the chain executes for a normal Process Chain.
    In the case of meta chains (as explained by me earlier) this lock appears as the execution of the local chain begins BUT even if you leave RSPC the lock remains for the local chain.
    In both these scenarios deletion of this lock kicks of the normal execution of the Process Chain.
    Thanks everyone for your inputs.
    Cheers,
    Melwyn

  • Urgent : Exception Type Problem

    Hallo,
    I am having strange problem with Exception type.
    we are having following architecture on Serverside.
    EJB -> SessionFacade-Bean also EJB (calls EJB's methods)
    -> Businessdelegate (Calls SessionFacade Method) -> Web-Tier with struts (call Businessdelegate))
    Where EJB & SessionFacade are in jar, and Businessdelegate(with Action classes & jsp's) are in war file.
    Let's assume that i am having
    * EJB -> MycounterEJB with method : check() throws CounterException()
    * SessionFacadeBean -> MyCounterSessionFacade with method : check() throws CounterException()
    (internally it calls MycounterEJB.check() & much more, if it gets Exception from MycounterEJB then throws it again)
    * BusinessDelegate -> MycounterBusinessdelegate with method : check() throws CounterException()
    (internally it calls MyCounterSessionFacade.check() & much more, it gets Exception from MyCounterSessionFacade then throws it again))
    Now Strange is, upto SessionFacadeBean i am getting Exception of correct type - CounterException,
    but in businessdelegate,
    i am getting Exception thrown by SessionFacadebean as type of Exception not of CounterException in MycounterBusinessdelegate,i can't understand,
    why container is chaging Exception type !!
    I have tried with 9.0.3 & 9.0.4, but getting same problem.
    At present we can't change our design, but we have to solve this problem.
    ( because the exception thrown by EJB or SessionFacadeBean contains errorMessages to be displayed in JSP)
    here is simple example, which helps u to understand my problem.
    ---------- Pure EJB ( in .JAR) ---------------------
    public class CounterBean implements SessionBean {
    For Testing tried to do something,
    so that method throws CEception,
    public void updateValue(String val)
    throws AException, BException, CException {
    try {
    // try to do something
    // if Error then throws exception
    } catch (AException e) {
    throw e;
    } catch (BException e) {
    throw e;
    } catch (CException e) {
    // For Test : it is throwning this exception
    throw e;
    catch (Exception e) {
    throw e;
    ---------- Session Facade (in .JAR) --------------
    public class CounterFacadeBean implements SessionBean {
    public void updateValue(String val)
    throws AException, BException, CException {
    try {
    // get ref to CounterBean , let's call it mybean
    mybean.updateValue(val);
    } catch (AException e) {
    throw e;
    } catch (BException e) {
    throw e;
    } catch (CException e) {
    // it should come here, as Bean throws Exception of tye CException
    // it shows correct type with sys.out
    throw e;
    catch (Exception e) {
    throw e;
    ---------- Business Delegate (in .WAR) ----------
    public class CounterDelegate
    implements CounterDelegateInterface
    public void updateClassification (String val)
    throws AException, BException, CException
    try
    CounterFacade facade = getCounterFacade();
    facade.updateValue(String val)
    catch (AException e) {
    throw e;
    } catch (BException e) {
    throw e;
    } catch (CException e) {
    // it should come here, as CounterFacadeBean throws CException
    // but it never comes here
    throw e;
    catch (RemoteException e)
    throw new AException(e.getMessage());
    catch (Exception e) {
    // ALWAYS Comes here, Although the Exception type thrown by CounterFacadeBea was of
    // type CException
    throw e;

    Would suggest you couple of things
    1. In your code you are throwing an exception of type Exception and you have not mentioned in the "throws" clause, you need to mention that.
    so you probably need to rewrite something like this
    public void xyzMethod throws AException, BException, Exception ()
    2. All the remote methods of SessionFacade have to throw "java.rmi.RemoteException"
    so for those methods that are in the RemoteInterface and also the corresponding implemtations should throw all your custom exceptions and also the "RemoteException" and also "Exception" if requried
    Try with these changes and let us know
    Thank you
    --Mallik

  • Pls help..Constructor,setter, getter and Exception Handling Problem

    halo, im new in java who learning basic thing and java.awt basic...i face some problem about constructor, setter, and getter.
    1. I created a constructor, setter and getter in a file, and create another test file which would like to get the value from the constructor file.
    The problem is: when i compile the test file, it come out error msg:cannot find symbol.As i know that is because i miss declare something but i dont know what i miss.I post my code here and help me to solve this problem...thanks
    my constructor file...i dont know whether is correct, pls tell me if i miss something...
    public class Employee{
         private int empNum;
         private String empName;
         private double empSalary;
         Employee(){
              empNum=0;
              empName="";
              empSalary=0;
         public int getEmpNum(){
              return empNum;
         public String getName(){
              return empName;
         public double getSalary(){
              return empSalary;
         public void setEmpNum(int e){
              empNum = e;
         public void setName(String n){
              empName = n;
         public void setSalary(double sal){
              empSalary = sal;
    my test file....
    public class TestEmployeeClass{
         public static void main(String args[]){
              Employee e = new Employee();
                   e.setEmpNum(100);
                   e.setName("abc");
                   e.setSalary(1000.00);
                   System.out.println(e.getEmpNum());
                   System.out.println(e.getName());
                   System.out.println(e.getSalary());
    }**the program is work if i combine this 2 files coding inside one file(something like the last part of my coding of problem 2)...but i would like to separate them....*
    2. Another problem is i am writing one simple program which is using java.awt interface....i would like to add a validation for user input (something like show error msg when user input character and negative number) inside public void actionPerformed(ActionEvent e) ...but i dont have any idea to solve this problem.here is my code and pls help me for some suggestion or coding about exception. thank a lots...
    import java.awt.*;
    import java.awt.event.*;
    public class SnailTravel extends Frame implements ActionListener, WindowListener{
       private Frame frame;
       private Label lblDistance, lblSpeed, lblSpeed2, lblTime, lblTime2, lblComment, lblComment2 ;
       private TextField tfDistance;
       private Button btnCalculate, btnClear;
       public void viewInterface(){
          frame = new Frame("Snail Travel");
          lblDistance = new Label("Distance");
          lblSpeed = new Label("Speed");
          lblSpeed2 = new Label("0.0099km/h");
          lblTime = new Label("Time");
          lblTime2 = new Label("");
          lblComment = new Label("Comment");
          lblComment2 = new Label("");
          tfDistance = new TextField(20);
          btnCalculate = new Button("Calculate");
          btnClear = new Button("Clear");
          frame.setLayout(new GridLayout(5,2));
          frame.add(lblDistance);
          frame.add(tfDistance);
          frame.add(lblSpeed);
          frame.add(lblSpeed2);
          frame.add(lblTime);
          frame.add(lblTime2);
          frame.add(lblComment);
          frame.add(lblComment2);
          frame.add(btnCalculate);
          frame.add(btnClear);
          btnCalculate.addActionListener(this);
          btnClear.addActionListener(this);
          frame.addWindowListener(this);
          frame.setSize(100,100);
          frame.setVisible(true);
          frame.pack();     
        public static void main(String [] args) {
            SnailTravel st = new SnailTravel();
            st.viewInterface();
        public void actionPerformed(ActionEvent e) {
           if (e.getSource() == btnCalculate){
              SnailData sd = new SnailData();
           double distance = Double.parseDouble(tfDistance.getText());
           sd.setDistance(distance);
                  sd.setSpeed(0.0099);
              sd.setTime(distance/sd.getSpeed());
              String answer = Double.toString(sd.getTime());
              lblTime2.setText(answer);
              lblComment2.setText("But No Exception!!!");
           else
           if(e.getSource() == btnClear){
              tfDistance.setText("");
              lblTime2.setText("");
       public void windowClosing(WindowEvent e){
                   System.exit(1);
        public void windowClosed (WindowEvent e) { };
        public void windowDeiconified (WindowEvent e) { };
        public void windowIconified (WindowEvent e) { };
        public void windowActivated (WindowEvent e) { };
        public void windowDeactivated (WindowEvent e) { };
        public void windowOpened(WindowEvent e) { };
    class SnailData{
       private double distance;
       private double speed;
       private double time;
       public SnailData(){
          distance = 0;
          speed = 0;
          time = 0;
       public double getDistance(){
          return distance;
       public double getSpeed(){
          return speed;
       public double getTime(){
          return time;
       public void setDistance(double d){
          distance = d;
       public void setSpeed(double s){
          speed = s;
       public void setTime(double t){
          time = t;
    }Pls and thanks again for helps....

    What i actually want to do is SnailTravel, but i facing some problems, which is the
    - Constructor,setter, getter, and
    - Exception Handling.
    So i create another simple contructor files which name Employee and TestEmployeeClass, to try find out the problem but i failed, it come out error msg "cannot find symbol".
    What i want to say that is if i cut below code (SnailTravel) to its own file(SnailData), SnailTravel come out error msg "cannot find symbol".So i force to put them in a same file(SnailTravel) to run properly.
    I need help to separate them. (I think i miss some syntax but i dont know what)
    And can somebody help me about Exception handling too pls.
    class SnailData{
       private double distance;
       private double speed;
       private double time;
       public SnailData(){
          distance = 0;
          speed = 0;
          time = 0;
       public double getDistance(){
          return distance;
       public double getSpeed(){
          return speed;
       public double getTime(){
          return time;
       public void setDistance(double d){
          distance = d;
       public void setSpeed(double s){
          speed = s;
       public void setTime(double t){
          time = t;

  • Simple exception handling

    Hello,
    I am trying to figure out how to add exception handling to a procedure so that I can save the error message into a table. Here is the simple procedure that calls another procedure, and the error is always due to some problem in the subprocedure, which will continue to occur periodically:
    (var1 integer, var2 integer)
    is
    begin
    subprocedure (var1, var2);
    commit;
    end;
    Here is my guess for adding exception handling:
    (var1 integer, var2 integer)
    is
    begin
    subprocedure (var1, var2);
    exception
    insert into errortable (col1) values (error_message);
    commit;
    end;
    I currently have the java setup with error handling using the try-catch system which displays the oracle error message in the tomcat window.
    How do I setup the oracle procedure to send my user-defined error message to the tomcat window?
    Any suggestions are greatly appreciated. TIA.

    raise_application_error will automatically end the transaction by calling ROLLBACK.
    So you may have to COMMIT before calling raise_application_error to perserve your insert.
    But i see you are writing into errorlog. The best way to do it is have a seperate procedure, define it as a autonomous transation and call it in your exception block. Something like this
    create or replace procedure log_error(pErrorMessage varchar2, pDate date)
    as
      pragma autonomous_transaction;
    begin
      insert into errorlog values (pErrorMessage, pDate);
      commit;
    end;
    /in your exception block do this.
    EXCEPTION
    WHEN OTHERS THEN
    log_error(dbms_utility.format_error_stack,SYSDATE)---Insert Into your Table--
    raise_application_error(-20101, dbms_utility.format_error_stack); ---Raise application error back to Java App---

  • Need help!  Simple session object problem.

    Help! I've been working on this for 4 days, but I'm sure it's simple if you are experienced. I'm receiving an error when I try to create the session variable (line 29)
    I just want to
    A) take the record ID's from a string variable on a sort page,
    B) create a string session variable which has those ID's
    C) and then pass it to the cart page, where the ID's will be used to display multiple records.
    1) (From the sort page), using an ADD TO CART BUTTON, Pass the record ID's in the String chkValues[] to a session variable.
    2)Figure out how to be able to access that session variable from the cart page: (The issue is that the form on the sort page already uses a GET method to perform the sort.)
    ERROR
    500 Internal Server Error - /jserv/Detail2.jsp:
    Compilation error occured:
    Found 2 errors in JSP file:
    C:\\Inetpub\\wwwroot\\Beachwear\\jserv\\Detail2.jsp:27: Syntax: Expression expected after this token
    <%@page language="java" import="java.sql.*"%>
    <%@ include file="../Connections/connBeachwear.jsp" %>
    <%@page language="java" import="java.sql.*,java.util.*"%><%//ADDED 12/14 %>
    <%
    //INCLUDE CHECKED ITEMS IN SORT:
    String rsBeachwear__varCheckbox = "1";
    if (request.getParameter ("valueCheckbox") !=null) {rsBeachwear__varCheckbox = (String)request.getParameter ("valueCheckbox")   ;}
    %>
    <%
    String rsBeachwear__name = "ID";//default sort value
         if (request.getParameter ("order") !=null) {rsBeachwear__name = (String)request.getParameter ("order");}
    String rsBeachwear__sort = "ASC";//default sort value
         if (request.getParameter ("sort") !=null) {rsBeachwear__sort = (String)request.getParameter ("sort");}
    String rsBeachwear__orderby ="ID";//default value
         if (request.getParameter ("order") !=null) {rsBeachwear__orderby = (String)request.getParameter("order");}
    String rsBeachwear__sortby ="ASC";//default value
         if (request.getParameter ("sort") !=null) {rsBeachwear__sortby = (String)request.getParameter("sort");}
    %>
    <%
    Driver DriverrsBeachwear = (Driver)Class.forName(MM_connBeachwear_DRIVER).newInstance();
    Connection ConnrsBeachwear = DriverManager.getConnection(MM_connBeachwear_STRING,MM_connBeachwear_USERNAME,MM_connBeachwear_PASSWORD);
    String chkValues[]=request.getParameterValues("valueCheckbox");
    session.setAttribute("chkValues2",chkValues[]);          //AND NOW MAY BE ADDED TO CART
    StringBuffer prepStr=new StringBuffer("SELECT ID, Item, Color, Size FROM Beachwear WHERE ID=");
    for(int x = 0; x < chkValues.length; ++x) {
         prepStr.append(chkValues[x]);
         if((x+1)<chkValues.length){
              prepStr.append(" OR ID=");
              }//end if
         }//end for loop
         prepStr.append(" ORDER BY " + rsBeachwear__name + " " + rsBeachwear__sort ); //NEW SQL SORT CODE:
    PreparedStatement StatementrsBeachwear=ConnrsBeachwear.prepareStatement(prepStr.toString());
    ResultSet rsBeachwear = StatementrsBeachwear.executeQuery();
    Object rsBeachwear_data;
    %>
    <title>Beachwear Title</title>
    <body bgcolor="#FFFFFF">
    <p align="center"><b><font size="4">DETAIL PAGE</font></b></p>
    <form name="form1" method="get" action="Detail2.jsp">
    <table width="75%" border="1">
    <tr>
    <td width="20%">
    <div align="center">Sort Parameter </div>
    </td>
    <td width="19%">
    <div align="center">Sort 1</div>
    </td>
    <td width="25%">
    <div align="center">Sort 2</div>
    </td>
    <td width="36%">
    <div align="center">Add Records to Cart:</div>
    </td>
    <td width="36%">
    <div align="center">
    <div align="center">Go to Cart</div>
    </div>
    </td>
    </tr>
    <tr>
    <td width="20%">
    <div align="center">
    <input type="submit" value="Sort /Select" name="submit">
    </div>
    </td>
    <td width="19%">
    <div align="center">
    <select name="order" size="1">
    <option value="ID" <% if (rsBeachwear__orderby.equals("ID")) {out.print("selected"); } %> >ID</option>
    <option value="Item" <% if (rsBeachwear__orderby.equals("Item")) {out.print("selected"); } %> >Item</option>
    <option value="Color" <% if (rsBeachwear__orderby.equals("Color")) {out.print("selected"); } %> >Color</option>
    <option value="Size" <% if (rsBeachwear__orderby.equals("Size")) {out.print("selected"); } %> >Size</option>
    </select>
    </div>
    </td>
    <td width="25%">
    <div align="center">
    <select name="sort" size="1">
    <option value="ASC" <% if (rsBeachwear__sortby.equals("ASC")) {out.print("selected"); } %>>Ascending</option>
    <option value="DESC" <% if (rsBeachwear__sortby.equals("DESC")) {out.print("selected"); } %>>Descending</option>
    </select>
    </div>
    </td>
    <td width="36%">
    <div align="center">
    <input type="submit" name="Submit" value="Add to Cart">
    </div>
    </td>
    <td width="36%">
    <div align="center">
    <div align="center">
    <input type="button" name="butGoToCart" value="Go to Cart" onClick="window.location='../jserv/Cart2.jsp'">
    </div>
    </div>
    </td>
    </tr>
    </table>
    <p>�</p>
    <%while(rsBeachwear.next()){%>
    <table width="75%" border="1">
    <tr>
    <td width="17%">ID:</td>
    <td width="58%"><%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="25%">
    <div align="center">Include in Sort:
    <input type="checkbox" name="valueCheckbox" value="<%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%>" checked>
    </div>
    </td>
    </tr>
    <tr>
    <td width="17%">ITEM:</td>
    <td colspan="3"><%=(((rsBeachwear_data = rsBeachwear.getObject("Item"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="17%">COLOR:</td>
    <td colspan="3"><%=(((rsBeachwear_data = rsBeachwear.getObject("Color"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="17%">SIZE:</td>
    <td colspan="3"><%=(((rsBeachwear_data = rsBeachwear.getObject("Size"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="17%" bgcolor="#00FFFF" bordercolor="#FFFFFF">
    <div align="left"></div>
    </td>
    <td colspan="3" bgcolor="#00FFFF" bordercolor="#FFFFFF">� </td>
    </tr>
    </table>
    <%
    %>
    <p>�</p>
    </form>
    <%
    rsBeachwear.close();
    ConnrsBeachwear.close();
    %>

    Thanks so much for your informative response!
    I would value your advice and direction to correct the structure of the code, but I am a very methodical person and first must complete the prototype in JSP before I go on to the next step of applying the MVC structure to correct the inefficiencies. (Also, it will be invaluable to the learning process be able to compare the two.) Just as in learning Math, you must learn the long way of problem solving before you apply the sophisticated, less error prone, and more structured approach.
    I have a sort that works pefectly, and displays only the records that have "checks" in the checkboxes. By unchecking the checkbox for individual records, (and then pressing the Sort/Select button), the sort is re-run using only the ID's of records that have been "checked."
    When ADD TO CART is pressed, I want to pass the ID's from the displayed records to a persistent session variable. And then when "DISPLAY CART" is pressed, I want to view a sort page EXACTLY like the original sort page, except the variable holding the diplayed records IS the persistent session variable. I'm not sure how to add only unique ID's to the session variable?
    I'd appreciate any assistance to complete this step, so I can go on and develop the MVC structure.
    Thank you again.
    <%@page language="java" import="java.sql.*"%>
    <%@ include file="../Connections/connBeachwear.jsp" %>
    <%@page language="java" import="java.sql.*,java.util.*"%><%//ADDED 12/14 %>
    <%
    //INCLUDE CHECKED ITEMS IN SORT:
    String rsBeachwear__varCheckbox = "1";
    if (request.getParameter ("valueCheckbox") !=null) {rsBeachwear__varCheckbox = (String)request.getParameter ("valueCheckbox")   ;}
    %>
    <%
    String rsBeachwear__name = "ID";//default sort value
    if (request.getParameter ("order") !=null) {rsBeachwear__name = (String)request.getParameter ("order");}
    String rsBeachwear__sort = "ASC";//default sort value
    if (request.getParameter ("sort") !=null) {rsBeachwear__sort = (String)request.getParameter ("sort");}
    String rsBeachwear__orderby ="ID";//default value
    if (request.getParameter ("order") !=null) {rsBeachwear__orderby = (String)request.getParameter("order");}
    String rsBeachwear__sortby ="ASC";//default value
    if (request.getParameter ("sort") !=null) {rsBeachwear__sortby = (String)request.getParameter("sort");}
    %>
    <%
    Driver DriverrsBeachwear = (Driver)Class.forName(MM_connBeachwear_DRIVER).newInstance();
    Connection ConnrsBeachwear = DriverManager.getConnection(MM_connBeachwear_STRING,MM_connBeachwear_USERNAME,MM_connBeachwear_PASSWORD);
    String chkValues[]=request.getParameterValues("valueCheckbox");
    session.setAttribute("chkValues2",chkValues); //IS THIS THE CORRECT WAY TO ADD ID'S TO A SESSION VARIABLE?
    StringBuffer prepStr=new StringBuffer("SELECT ID, Item, Color, Size FROM Beachwear WHERE ID=");
    for(int x = 0; x < chkValues.length; ++x) {
    prepStr.append(chkValues[x]);
    if((x+1)<chkValues.length){
    prepStr.append(" OR ID=");
    }//end if
    }//end for loop
    prepStr.append(" ORDER BY " + rsBeachwear__name + " " + rsBeachwear__sort ); //NEW SQL SORT CODE:
    PreparedStatement StatementrsBeachwear=ConnrsBeachwear.prepareStatement(prepStr.toString());
    ResultSet rsBeachwear = StatementrsBeachwear.executeQuery();
    Object rsBeachwear_data;
    %>
    <title>Beachwear Title</title>
    <body bgcolor="#FFFFFF">
    <p align="center"><b><font size="4">DETAIL PAGE</font></b></p>
    <form name="form1" method="get" action="Detail2.jsp">
    <table width="75%" border="1">
    <tr>
    <td width="20%">
    <div align="center">Sort Parameter </div>
    </td>
    <td width="19%">
    <div align="center">Sort 1</div>
    </td>
    <td width="25%">
    <div align="center">Sort 2</div>
    </td>
    <td width="36%">
    <div align="center">Add Records to Cart:</div>
    </td>
    <td width="36%">
    <div align="center">
    <div align="center">View Cart</div>
    </div>
    </td>
    </tr>
    <tr>
    <td width="20%">
    <div align="center">
    <input type="submit" value="Sort /Select" name="submit">
    </div>
    </td>
    <td width="19%">
    <div align="center">
    <select name="order" size="1">
    <option value="ID" <% if (rsBeachwear__orderby.equals("ID")) {out.print("selected"); } %> >ID</option>
    <option value="Item" <% if (rsBeachwear__orderby.equals("Item")) {out.print("selected"); } %> >Item</option>
    <option value="Color" <% if (rsBeachwear__orderby.equals("Color")) {out.print("selected"); } %> >Color</option>
    <option value="Size" <% if (rsBeachwear__orderby.equals("Size")) {out.print("selected"); } %> >Size</option>
    </select>
    </div>
    </td>
    <td width="25%">
    <div align="center">
    <select name="sort" size="1">
    <option value="ASC" <% if (rsBeachwear__sortby.equals("ASC")) {out.print("selected"); } %>>Ascending</option>
    <option value="DESC" <% if (rsBeachwear__sortby.equals("DESC")) {out.print("selected"); } %>>Descending</option>
    </select>
    </div>
    </td>
    <td width="36%">
    <div align="center">
    <input type="submit" name="Submit" value="Add to Cart">
    </div>
    </td>
    <td width="36%">
    <div align="center">
    <div align="center">
    <input type="button" name="butViewCart" value="View Cart" onClick="window.location='../jserv/Cart2.jsp'">
    </div>
    </div>
    </td>
    </tr>
    </table>
    <p> </p>
    <%while(rsBeachwear.next()){%>
    <table width="75%" border="1">
    <tr>
    <td width="17%">ID:</td>
    <td width="58%"><%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="25%">
    <div align="center">Include in Sort:
    <input type="checkbox" name="valueCheckbox" value="<%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%>" checked>
    </div>
    </td>
    </tr>
    <tr>
    <td width="17%">ITEM:</td>
    <td colspan="3"><%=(((rsBeachwear_data = rsBeachwear.getObject("Item"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="17%">COLOR:</td>
    <td colspan="3"><%=(((rsBeachwear_data = rsBeachwear.getObject("Color"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="17%">SIZE:</td>
    <td colspan="3"><%=(((rsBeachwear_data = rsBeachwear.getObject("Size"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="17%" bgcolor="#00FFFF" bordercolor="#FFFFFF">
    <div align="left"></div>
    </td>
    <td colspan="3" bgcolor="#00FFFF" bordercolor="#FFFFFF">  </td>
    </tr>
    </table>
    <%
    %>
    <p> </p>
    </form>
    <%
    rsBeachwear.close();
    ConnrsBeachwear.close();
    %>

  • Process chain problem...., its urgent

    Hi all
    in my process chain we are loading 4 loads into ODS. After 3 loads, 4th load didn't take place. its not yet started even 3rd one successfully ran. its not showing error also. what can i do. after 4th one ODS activation process is there.
    Please advice me. will i go for manual loading. if i do manual, what abt activation after 4th load. will i do activation also manual or else it will trigger automatically as part of process chain........../
    Advice me frnds..., its urgent
    Regards
    swetha

    Hi Swetha,
    Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
    You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
    Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
    In the opened popup click on the tab 'Chain'.
    In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
    1. copy the variant from the popup to the variante of table rspcprocesslog
    2. copy the instance from the popup to the instance of table rspcprocesslog
    3. copy the start date from the popup to the batchdate of table rspcprocesslog
    Press F8 to display the entries of table rspcprocesslog.
    Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
    Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
    1. rspcprocesslog-log_id -> i_logid
    2. rspcprocesslog-type -> i_type
    3. rspcprocesslog-variante -> i_variant
    4. rspcprocesslog-instance -> i_instance
    5. enter 'G' for parameter i_state (sets the status to green).
    Now press F8 to run the fm.
    Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.
    Of course you can also set the state of a specific step in the chain to any other possible value like 'R' = ended with errors, 'F' = finished, 'X' = cancelled ....
    Check out the value help on field rspcprocesslog-state in transaction se16 for the possible values.
    Try this solution with your 3rd ODS..hope this will solve your problem for this instance. This is just a workaround.
    Before next scheduel of the process chain..remove the link between 3rd ODS and 4th ODS and then reconnect once again and activate the process chain and schedule it as per your schedule cycle. From next upload onwards everything works fine.
    Assign points if it is helpful.
    Regards,
    Sreedhar

  • Exception handling problem

    Hi, i have a database whereby people can look up customer records based on their order numbers. If the order number does not exist, an error should appear.
    Code:
    SET SERVEROUTPUT ON;
    DECLARE
    v_ordNum NUMBER(8) := &sv_odNum;
    v_fname VARCHAR2 (30);
    v_lname VARCHAR2 (30);
    v_add VARCHAR2 (30);
    v_num VARCHAR2 (10);
    BEGIN
    SELECT first, last, cadd, dphone
    INTO v_fname, v_lname, v_add, v_num
    FROM CUSTOMER c, ORDERS o
    WHERE c.custid = o.custid
    AND v_ordNum = o.orderid;
    DBMS_OUTPUT.PUT_LINE(' The name, address and telephone number of the customer follow: '
    ||v_fname|| ' ' ||v_lname ||' ' ||v_add||' ' ||v_num);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE(v_ordNum 'was not found. Please try again');
    END;
    When i enter a order number that does not exist i get this instead, y:
    SQL> @q1.sql
    Enter value for sv_odnum: 2331
    old 2: v_ordNum NUMBER(8) := &sv_odNum;
    new 2: v_ordNum NUMBER(8) := 2331;
    DBMS_OUTPUT.PUT_LINE(v_ordNum 'was not found. Please try again');
    ERROR at line 18:
    ORA-06550: line 18, column 33:
    PLS-00103: Encountered the symbol "was not found. Please try again" when
    expecting one of the following:
    . ( ) , * @ % & | = - + < / > at in mod not range rem => ..
    <an exponent (**)> <> or != or ~= >= <= <> and or like as
    between from using is null is not || is dangling
    The symbol "." was substituted for "was not found. Please try again" to
    continue.

    Hi,
    you were careful in using "||" while writing the previous DBMS_OUTPUT.PUT_LINE statement.
    do the same now aslo...
    DBMS_OUTPUT.PUT_LINE(v_ordNum || ' was not found. Please try again');
    Try now and tell me. Simple Errors you should be careful... you just have to read the error carefull and see what it says and why it is wrong.
    Regards
    Jagan

Maybe you are looking for

  • Not able to use Airtel121 selfcare service

    Hi, I m using airtel service. I m able to get messages from 121, I m able to send messages to my friends but I am not able to send messages on 121 which is selfcare service of Airtel. Whenever I try to send messages (Like DATA USE, CL or BP) on 121,

  • Install windows 8.1 on windows 7without external DVD-reader? - thinkpad Yoga

    Hi! Just entered the community as i recently bought a lenovo thinkpad S1 yoga. i am very satisfied with it overall, but right now there is one thing that bothers me. It came preinstalled with windows 7. Now, i did get recovery CDs with windows 8, but

  • Displaying Web Pages in a Flash Movie

    I'm new to Flash and AS 3 and I was wondering if it was possible to display a webpage in a Flash Movie.

  • To stop automatic generation of excise invoice for

    Dear Experts, I am creating Profroma Invoice just after Sales Order in export cycle. While saving the proforma invoice, system automatically generates excise invoice. Will you please guide me how to stop the Proforma Invoice from automatic generation

  • Error message - itunes needs to be reinstalled

    When I start itunes, I get an error message stating that itunes was not properly installed and I will not be able to get song info from the internet unless I reinstall itunes. Is this a repairable problem, or do I have to uninstall/reinstall? Also, i