Issue with exception Handling in GG

Hi,
I have bi-directional DML replication setup. I have written a code in replication parameter for handling the exception , Exception handling is working fine my replicate process is not getting ABENDED but Issue is I am not geeting any rows in EXCEPTION table.I had gone through replicat report, there I had seen GG is trying to inser duplicate records in EXCEPTION TABLE and it is failing because of that .
**Command for create Exception Table is-**
create table ggs_admin.exceptions (
rep_name      varchar2(8) ,
table_name      varchar2(61) ,
errno      number ,
dberrmsg      varchar2(4000) ,
optype               varchar2(20) ,
errtype           varchar2(20) ,
logrba               number ,
logposition          number ,
committimestamp      timestamp,
CONSTRAINT pk_exceptions PRIMARY KEY (logrba, logposition, committimestamp)
USING INDEX
TABLESPACE INDX1
TABLESPACE dbdat1
My replication parameter is-
GGSCI (db) 1> view params rep2
-- Replicator parameter file to apply changes
REPLICAT rep2
ASSUMETARGETDEFS
USERID ggs_admin, PASSWORD ggs_admin
DISCARDFILE /u01/app/oracle/product/gg/dirdat/rep2_discard.dsc, PURGE
-- Start of the macro
MACRO #exception_handler
BEGIN
, TARGET ggs_admin.exceptions
, COLMAP ( rep_name = "REP2"
, table_name = @GETENV ("GGHEADER", "TABLENAME")
, errno = @GETENV ("LASTERR", "DBERRNUM")
, dberrmsg = @GETENV ("LASTERR", "DBERRMSG")
, optype = @GETENV ("LASTERR", "OPTYPE")
, errtype = @GETENV ("LASTERR", "ERRTYPE")
, logrba = @GETENV ("GGHEADER", "LOGRBA")
, logposition = @GETENV ("GGHEADER", "LOGPOSITION")
, committimestamp = @GETENV ("GGHEADER", "COMMITTIMESTAMP"))
, INSERTALLRECORDS
, EXCEPTIONSONLY;
END;
-- End of the macro
REPERROR (DEFAULT, EXCEPTION)
--REPERROR (-1, EXCEPTION)
--REPERROR (-1403, EXCEPTION)
MAP scr.order_items, TARGET scr.order_items;
MAP scr.order_items #exception_handler();
GGSCI (db) 2>view params rep2
MAP resolved (entry scr.order_items):
MAP "scr"."order_items" TARGET ggs_admin.exceptions , COLMAP ( rep_name = "REP2" , table_name = @GETENV ("GGHEADER", "TABLENAME") , errno = @GETENV ("LASTERR", "DB
ERRNUM") , dberrmsg = @GETENV ("LASTERR", "DBERRMSG") , optype = @GETENV ("LASTERR", "OPTYPE") , errtype = @GETENV ("LASTERR", "ERRTYPE") , logrba = @GETENV ("GGHEADER"
, "LOGRBA") , logposition = @GETENV ("GGHEADER", "LOGPOSITION") , committimestamp = @GETENV ("GGHEADER", "COMMITTIMESTAMP")) , INSERTALLRECORDS , EXCEPTIONSONLY;;
Using the following key columns for target table GGS_ADMIN.EXCEPTIONS: LOGRBA, LOGPOSITION, COMMITTIMESTAMP.
2012-08-30 09:09:00 WARNING OGG-01154 SQL error 1403 mapping scr.order_items to scr.order_items OCI Error ORA-01403: no data found, SQL <DELETE FROM "scr"."order_items" WHERE "SUBSCRIBER_ID" = :b0>.
2012-08-30 09:09:00 WARNING OGG-00869 OCI Error ORA-00001: unique constraint (GGS_ADMIN.PK_EXCEPTIONS) violated (status = 1). INSERT INTO "GGS_ADMIN"."EXCEPTIONS" ("R
EP_NAME","TABLE_NAME","ERRNO","DBERRMSG","OPTYPE","ERRTYPE","LOGRBA","LOGPOSITION","COMMITTIMESTAMP") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8).
2012-08-30 09:09:00 WARNING OGG-01004 Aborted grouped transaction on 'GGS_ADMIN.EXCEPTIONS', Database error 1 (OCI Error ORA-00001: unique constraint (GGS_ADMIN.PK_EX
CEPTIONS) violated (status = 1). INSERT INTO "GGS_ADMIN"."EXCEPTIONS" ("REP_NAME","TABLE_NAME","ERRNO","DBERRMSG","OPTYPE","ERRTYPE","LOGRBA","LOGPOSITION","COMMITTIMES
TAMP") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8)).
2012-08-30 09:09:00 WARNING OGG-01003 Repositioning to rba 92383 in seqno 8.
2012-08-30 09:09:00 WARNING OGG-01154 SQL error 1403 mapping scr.order_items to scr.order_items OCI Error ORA-01403: no data found, SQL <DELETE FROM "scr"."order_items" WHERE "SUBSCRIBER_ID" = :b0>.
2012-08-30 09:09:00 WARNING OGG-01154 SQL error 1 mapping scr.order_items to GGS_ADMIN.EXCEPTIONS OCI Error ORA-00001: unique constraint (GGS_ADMIN.PK_EXCEPTIONS)
violated (status = 1). INSERT INTO "GGS_ADMIN"."EXCEPTIONS" ("REP_NAME","TABLE_NAME","ERRNO","DBERRMSG","OPTYPE","ERRTYPE","LOGRBA","LOGPOSITION","COMMITTIMESTAMP") VAL
UES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8).
2012-08-30 09:09:00 WARNING OGG-01003 Repositioning to rba 92383 in seqno 8.
When I am running command
select * from exceptions;
no row selected.
Please help. Why duplicat rows trying to insert in Exception table.

Remove (disable) the constraint on the exceptions table and see if inserts will take place. Do you really need that primary key?

Similar Messages

  • Issue with Exceptions in Reporting

    Hi BW Gurus,
                I am still new to BW, Like I have a issue with exceptions in reporting.
                Let me explain clearly, I created a report which gives me two MRP values they are for example V1 and PD(there other MRP types but I am focusing only this two). Here I can see in my report those two values and the overall result of all MRP types (they are 6 different types). My report looks like this for examply
       V1                  46,782,434(this are rough figures)
       PD                  56,232,453
       Overall Result      102,434,111
            Here my requirement is I need to find this overall result like accroding to thresold values this overall result shows RED,YELLOW,GREEN.
            I have given threshold values in exceptions. like
       0           -
    > 45,000,000(Red)
       45,000,001  -
    > 65,000,000 (Yellow)
       65,000,001  -
    > 500,000,000 (Green)
           But according to this values I should get Red( Overall Result), I cant see any change in the overall result.
           Please can some one give advice how to reflect this threshold values in my report.Or I have to select any other options in exceptions.
           Thanks in advance.
    Regds
    Sam

    Not really possible with BEx functions, but if you provide a workbook to users you can just type in this information in a non-Bex cell and save the workbook.
    Else you can try to name your exception such that it shows the value ranges. Then in the report, from the toolbar Layout > Display Exceptions.
    Hope this helps...

  • Query issue with exception aggregation

    Dear all,
    I have to solve the following reporting issue with BEx:
    Cube Structure:
    Cube A:
    Characteristics: Company Code, Article, Distribution Channel, Customer, FiscalYear/Period
    Key-Figures: Sales Val., Sales Qty.
    Cube B:
    Characteristics: Company Code, Article, FiscalYear/Period
    Key-Figures: COGS
    I simply want to multiply:  Sales Qty@COGS = NODIM(Sales Qty) * COGS,
    but this calculation should be valid for all characteristics of my cube A, even if I do not have them available in Cube B (like Customer and Distribution Channel). Additionally the calculated totals of my characteristics must be correct so that I can apply in second step a Margin Calculation: Sales Val. - Sales Qty@COGS which is valid on single level, as well as on total level.
    I started to setup calculated key-figures
    COGS1 = NODIM(Sales Qty) * COGS   with Exception aggregation TOTAL by Company Code
    COGS2 = COGS1 with Exception Aggregation TOTAL by Article
    and this worked fine for both characteristics. If I use COGS2 in my report I get correct figures in a drilldown by Company Code and Article.
    I enhanced the calculation by
    COGS3 = COGS2 with Exception Aggregation TOTAL by Distribution Channel, but the result in this case is 0. I guess the result is 0, as the characteristic Distribution Channel is not availble in Cube B.
    Any ideas how to solve this? Is there probably a different (more elegant) approach, as I fear that having all the exception aggregations my query runtime/ressource consumption will be awful.
    Thanks for any idea,
    Andreas

    Hi,
    You should define a new selection for COGS having Constant Selection on DC as defined in following link for PRICE with CUSTOMER.
    [http://help.sap.com/saphelp_nw70/helpdata/en/46/91f0f090ea13e8e10000000a155369/content.htm]
    and then apply your formulas....
    hope it will solve the problem...
    Regards.

  • Having troubles with exception handling

    Do you have Objective-C exception handling turned on?

    etresoft wrote:
    Den B. wrote:
    I'm sorry, but how do you do that?
    Double-click the project entry at the top of your Xcode file list.
    Click the Build tab
    Search for "exception"
    Yeah, I did this in the first place but I still can't catch that exception in the code block I posted above. In the console window they call it NSInvalidArgumentException but when I put it specifically into the @catch statement it doesn't want to compile...

  • Multiple Idocs to XI with exception handling.

    Hi,
    I m doing a scenario,sending multiple idocs to file via XI.while doing dis,i m using BPM.For the BPM part i m following the blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2034..but [original link is broken] [original link is broken] [original link is broken] [original link is broken] wen i check in SXMB_MONI,my message isn't successfully processed out f BPM.In this,exception is triggered at d beginning.and it always throw exception and message not successfully processed out f BPM.In the workflow it is showing error in the first step and remaining steps are compIeted.Here, i m throwing exception by the use f deadline branch.Can,anybody tell me how to handle dis exception/error?

    Hi Rajeev,
    I am using a loop with in a block inside the BPM inside which receive step and container element is used.In parallel to loop branch,i m using deadline and exception branch same as in blog 2034.i m using infinite loop wid time limit mentioned in the deadline branch.After coming out f dis block,i m using transformation step and den send step is used.When i check in graphical workflow,i m getting error in send step stating that an empty container element is used while sending.But,wen i m checking technical workflow,i m getting error in first step after the creation of workflow and workflow started messages in the log details.after which the exception occured is shown in the workflow system..
    Thanks,
    Anoop Garg

  • RichDialog doesn't close with exception handling in DialogListener

    I have a RichPopup with a child that is a RichDialog. The popup is called using a command button with a showPopupBehavior child.
    I have a DialogListener on the RichDialog that calls a web service method through a proxy.
    I added a try/catch block around the web service method call and then added a call to the FacesContext to add a message to display to the user. If there is an exception thrown from the service (simulated at this point) the message is displayed, but the screen is greyed out and the dialog will not close.
    What am I missing?
    Thanks,
    Al
    Message was edited by:
    Al-2000

    I don't think there are any examples, however something like this might do the trick:
    ---- Put this in your page ----
    <f:verbatim>
    <![CDATA[
    <script>/*ignore the leading greater-than symbol that this forum adds to the start of this line*/
    function closeMyPopup()
      var popup = AdfPage.PAGE.findComponent("myPopupClientId");
      popup.hide();
    </script>
    ]]>
    </f:verbatim>---- Put this in your Java code where you deal with the error ----
    ExtendedRenderKitService erks =
      Service.getService(
        facesContext.getRenderKit(),
        ExtendedRenderKitService.class); 
    erks.addScript(facesContext, "closeMyPopup();");See also the org.apache.myfaces.trinidad.render.ExtendedRenderKitService JavaDoc:
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/multiproject/adf-faces-api/apidocs/org/apache/myfaces/trinidad/render/ExtendedRenderKitService.html
    Regards,
    Matt

  • Having an issue with event handling - sql & java

    HI all am trying to construct this hybrid of java and mysql. the data comes from a mysql database and I want it to display in the gui. this I have achieved thus far. However I have buttons that sort by surname, first name, ID tag etc....I need event handlers for these buttons but am quite unsure as to how to do it. any help would be much appreciated. Thanks in advance.
    /* Student Contact Database GUI
    * Phillip Wells
    import java.awt.BorderLayout;     
    // imports java class. All import class statements tell the compiler to use a class that is defined in the Java API.
    // Borderlayout is a layout manager that assists GUI layout.
    import javax.swing.*;               // imports java class. Swing enables the use of a GUI.
    import javax.swing.JOptionPane;     // imports java class. JOptionPane displays messages in a dialog box as opposed to a console window.
    import javax.swing.JPanel;          // imports java class. A component of a GUI.
    import javax.swing.JFrame;          // imports java class. A component of a GUI.
    import javax.swing.JButton;          // imports java class. A component of a GUI.
    import javax.swing.JScrollPane;     // imports java class. A component of a GUI.
    import javax.swing.JTable;          // imports java class. A component of a GUI.
    import java.awt.*;               // imports java class. Similar to Swing but with different components and functions.
    import java.awt.event.*;          // imports java class. Deals with events.
    import java.awt.event.ActionEvent;     // imports java class. Deals with events.
    import java.awt.event.ActionListener;     // imports java class. Deals with events.
    import java.sql.*;               // imports java class. Provides API for accessing and processing data stored in a data source.
    import java.util.*;               // imports java class. Contains miscellaneous utility classes such as strings.
    public class studentContact extends JFrame {     // public class declaration. The �public� statement enables class availability to other java elements. 
        private JPanel jContentPane;    // initialises content pane
        private JButton snam, id, fname, exit;     // initialises Jbuttons
        String firstname = "firstname"; //initialises String firstname
         String secondname = "secondname"; //initialises String
        public studentContact() {
            Vector columnNames = new Vector();      // creates new vector object. Vectors are arrays that are expandable.
            Vector data = new Vector();
            initialize();
            try {
                // Connect to the Database
                String driver = "com.mysql.jdbc.Driver"; // connect to JDBC driver
                String url = "jdbc:mysql://localhost/Studentprofiles"; //location of Database
                String userid = "root"; //user logon information for MySQL server
                String password = "";     //logon password for above
                Class.forName(driver); //reference to JDBC connector
                Connection connection = DriverManager.getConnection(url, userid,
                        password);     // initiates connection
                // Read data from a table
                String sql = "Select * from studentprofile order by "+ firstname;
                //SQL query sent to database, orders results by firstname.
                Statement stmt = connection.createStatement
                (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
                //statement to create connection.
                //Scroll sensitive allows movement forth and back through results.
                //Concur updatable allows updating of database.
                ResultSet rs = stmt.executeQuery(sql); // executes SQL query stated above and sets the results in a table
                ResultSetMetaData md = rs.getMetaData();     // used to get the properties of the columns in a ResultSet object.
                int columns = md.getColumnCount(); //
                for (int i = 1; i <= columns; i++) {
                    columnNames.addElement(md.getColumnName(i));     // Get column names
                while (rs.next()) {
                    Vector row = new Vector(columns);          // vectors data from table
                    for (int i = 1; i <= columns; i++) {     
                        row.addElement(rs.getObject(i));     // Get row data
                    data.addElement(row);     // adds row data
                rs.close();     
                stmt.close();
            } catch (Exception e) {     // catches exceptions
                System.out.println(e);     // prints exception message
            JTable table = new JTable(data, columnNames) {     //constructs JTable
                public Class getColumnClass(int column) {     
                    for (int row = 0; row < getRowCount(); row++) {
                        Object o = getValueAt(row, column);
                        if (o != null) {
                            return o.getClass();
                    return Object.class;
            JScrollPane scrollPane = new JScrollPane( table );          // constructs scrollpane 'table'
            getContentPane().add(new JScrollPane(table), BorderLayout.SOUTH);   //adds table to a scrollpane
        private void initialize() {
            this.setContentPane(getJContentPane());
            this.setTitle("Student Contact Database");     // sets title of table
            ButtonListener b1 = new ButtonListener();     // constructs button listener
            snam = new JButton ("Sort by surname");      // constructs Jbutton
            snam.addActionListener(b1);     // adds action listener
            jContentPane.add(snam);          //adds button to pane
            id = new JButton ("Sort by ID");      // constructs Jbutton
            id.addActionListener(b1);     // adds action listener
            jContentPane.add(id);          //adds button to pane
            fname = new JButton ("Sort by first name");      // constructs Jbutton
            fname.addActionListener(b1);     // adds action listener
            jContentPane.add(fname);          //adds button to pane
            exit = new JButton ("Exit");     // constructs Jbutton
            exit.addActionListener(b1);     // adds action listener
            jContentPane.add(exit);          //adds button to pane
        private JPanel getJContentPane() {
            if (jContentPane == null) {
                jContentPane = new JPanel();          // constructs new panel
                jContentPane.setLayout(new FlowLayout());     // sets new layout manager
            return jContentPane;     // returns Jcontentpane
        private class ButtonListener implements ActionListener {     // create inner class button listener that uses action listener
            public void actionPerformed (ActionEvent e)
                if (e.getSource () == exit)     // adds listener to button exit.
                   System.exit(0);     // exits the GUI
                if (e.getSource () == snam)
                if (e.getSource () == id)
                if (e.getSource () == fname)
        public static void main(String[] args) {     // declaration of main method
            studentContact frame = new studentContact();     // constructs new frame
            frame.setDefaultCloseOperation(EXIT_ON_CLOSE);     //exits frame on closing
            frame.setSize(600, 300);          // set size of frame
            frame.setVisible(true);     // displays frame
    }p.s. sorry about the untidy comments!

    OK, so you've got this code here:
    private class ButtonListener implements ActionListener {
      public void actionPerformed (ActionEvent e) {
        if (e.getSource () == exit) {
          System.exit(0); // exits the GUI
        if (e.getSource () == snam) {
        if (e.getSource () == id) {
    }Perfect fine way to do this; although I think creating anonymous would be a bit cleaner:
    snam.addActionListener(new actionListener() {
      public void actionPerformed(ActionEvent ae) {
    });But I think that the real question you have is "what do I put for logic when the JButtons are hit?", right?
    I would answer that you want to dynamically build your SQL statement changing your ordering based on the button.
    So you'd have a method that builds the SQL based on what you pass in - so it takes one argument perhaps?
    private static final int NAME = 1;
                             ID = 2;
    /* ... some code ... */
    snam.addActionListener(new actionListener() {
      public void actionPerformed(ActionEvent ae) {
        buildSQL(NAME);
    /* ... some code ... */
    private void buildSQL(int type) {
      if ( type == NAME ) {
    /* ... build SQL by name ... */
      else if ( type == ID ) {
    /* ... build SQL by id ... */
    }That kind of thing.
    Or you might choose to have several build methods with no parameter type; each building the SQL differently, and calling whichever one you need. I did not read your entire pgm, so I don't know how you'd want to organize it. You need to ask more specific questions at that point.
    ~Bill

  • Having an issue with event handling - sql database  & java gui

    HI all, have posted this on another forum but I think this is the correct one to post on. I am trying to construct this hybrid of java and mysql. the data comes from a mysql database and I want it to display in the gui. this I have achieved thus far. However I have buttons that sort by surname, first name, ID tag etc....I need event handlers for these buttons but am quite unsure as to how to do it. any help would be much appreciated. Thanks in advance.
    /* Student Contact Database GUI
    * Phillip Wells
    import java.awt.BorderLayout;     
    // imports java class. All import class statements tell the compiler to use a class that is defined in the Java API.
    // Borderlayout is a layout manager that assists GUI layout.
    import javax.swing.*;               // imports java class. Swing enables the use of a GUI.
    import javax.swing.JOptionPane;     // imports java class. JOptionPane displays messages in a dialog box as opposed to a console window.
    import javax.swing.JPanel;          // imports java class. A component of a GUI.
    import javax.swing.JFrame;          // imports java class. A component of a GUI.
    import javax.swing.JButton;          // imports java class. A component of a GUI.
    import javax.swing.JScrollPane;     // imports java class. A component of a GUI.
    import javax.swing.JTable;          // imports java class. A component of a GUI.
    import java.awt.*;               // imports java class. Similar to Swing but with different components and functions.
    import java.awt.event.*;          // imports java class. Deals with events.
    import java.awt.event.ActionEvent;     // imports java class. Deals with events.
    import java.awt.event.ActionListener;     // imports java class. Deals with events.
    import java.sql.*;               // imports java class. Provides API for accessing and processing data stored in a data source.
    import java.util.*;               // imports java class. Contains miscellaneous utility classes such as strings.
    public class studentContact extends JFrame {     // public class declaration. The �public� statement enables class availability to other java elements. 
    private JPanel jContentPane; // initialises content pane
    private JButton snam, id, fname, exit; // initialises Jbuttons
    String firstname = "firstname"; //initialises String firstname
    String secondname = "secondname"; //initialises String
    public studentContact() {
    Vector columnNames = new Vector();      // creates new vector object. Vectors are arrays that are expandable.
    Vector data = new Vector();
    initialize();
    try {
    // Connect to the Database
    String driver = "com.mysql.jdbc.Driver"; // connect to JDBC driver
    String url = "jdbc:mysql://localhost/Studentprofiles"; //location of Database
    String userid = "root"; //user logon information for MySQL server
    String password = "";     //logon password for above
    Class.forName(driver); //reference to JDBC connector
    Connection connection = DriverManager.getConnection(url, userid,
    password);     // initiates connection
    // Read data from a table
    String sql = "Select * from studentprofile order by "+ firstname;
    //SQL query sent to database, orders results by firstname.
    Statement stmt = connection.createStatement
    (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    //statement to create connection.
    //Scroll sensitive allows movement forth and back through results.
    //Concur updatable allows updating of database.
    ResultSet rs = stmt.executeQuery(sql); // executes SQL query stated above and sets the results in a table
    ResultSetMetaData md = rs.getMetaData();     // used to get the properties of the columns in a ResultSet object.
    int columns = md.getColumnCount(); //
    for (int i = 1; i <= columns; i++) {
    columnNames.addElement(md.getColumnName(i));     // Get column names
    while (rs.next()) {
    Vector row = new Vector(columns);          // vectors data from table
    for (int i = 1; i <= columns; i++) {     
    row.addElement(rs.getObject(i));     // Get row data
    data.addElement(row);     // adds row data
    rs.close();     
    stmt.close();
    } catch (Exception e) {     // catches exceptions
    System.out.println(e);     // prints exception message
    JTable table = new JTable(data, columnNames) {     //constructs JTable
    public Class getColumnClass(int column) {     
    for (int row = 0; row < getRowCount(); row++) {
    Object o = getValueAt(row, column);
    if (o != null) {
    return o.getClass();
    return Object.class;
    JScrollPane scrollPane = new JScrollPane( table ); // constructs scrollpane 'table'
    getContentPane().add(new JScrollPane(table), BorderLayout.SOUTH); //adds table to a scrollpane
    private void initialize() {
    this.setContentPane(getJContentPane());
    this.setTitle("Student Contact Database");     // sets title of table
    ButtonListener b1 = new ButtonListener();     // constructs button listener
    snam = new JButton ("Sort by surname");     // constructs Jbutton
    snam.addActionListener(b1);     // adds action listener
    jContentPane.add(snam);          //adds button to pane
    id = new JButton ("Sort by ID");     // constructs Jbutton
    id.addActionListener(b1);     // adds action listener
    jContentPane.add(id);          //adds button to pane
    fname = new JButton ("Sort by first name");     // constructs Jbutton
    fname.addActionListener(b1);     // adds action listener
    jContentPane.add(fname);          //adds button to pane
    exit = new JButton ("Exit");     // constructs Jbutton
    exit.addActionListener(b1);     // adds action listener
    jContentPane.add(exit);          //adds button to pane
    private JPanel getJContentPane() {
    if (jContentPane == null) {
    jContentPane = new JPanel();          // constructs new panel
    jContentPane.setLayout(new FlowLayout());     // sets new layout manager
    return jContentPane;     // returns Jcontentpane
    private class ButtonListener implements ActionListener {     // create inner class button listener that uses action listener
    public void actionPerformed (ActionEvent e)
    if (e.getSource () == exit)     // adds listener to button exit.
    System.exit(0);     // exits the GUI
    if (e.getSource () == snam)
    if (e.getSource () == id)
    if (e.getSource () == fname)
    public static void main(String[] args) {     // declaration of main method
    studentContact frame = new studentContact();     // constructs new frame
    frame.setDefaultCloseOperation(EXIT_ON_CLOSE);     //exits frame on closing
    frame.setSize(600, 300);          // set size of frame
    frame.setVisible(true);     // displays frame
    }

    OK, so you've got this code here:
    private class ButtonListener implements ActionListener {
      public void actionPerformed (ActionEvent e) {
        if (e.getSource () == exit) {
          System.exit(0); // exits the GUI
        if (e.getSource () == snam) {
        if (e.getSource () == id) {
    }Perfect fine way to do this; although I think creating anonymous would be a bit cleaner:
    snam.addActionListener(new actionListener() {
      public void actionPerformed(ActionEvent ae) {
    });But I think that the real question you have is "what do I put for logic when the JButtons are hit?", right?
    I would answer that you want to dynamically build your SQL statement changing your ordering based on the button.
    So you'd have a method that builds the SQL based on what you pass in - so it takes one argument perhaps?
    private static final int NAME = 1;
                             ID = 2;
    /* ... some code ... */
    snam.addActionListener(new actionListener() {
      public void actionPerformed(ActionEvent ae) {
        buildSQL(NAME);
    /* ... some code ... */
    private void buildSQL(int type) {
      if ( type == NAME ) {
    /* ... build SQL by name ... */
      else if ( type == ID ) {
    /* ... build SQL by id ... */
    }That kind of thing.
    Or you might choose to have several build methods with no parameter type; each building the SQL differently, and calling whichever one you need. I did not read your entire pgm, so I don't know how you'd want to organize it. You need to ask more specific questions at that point.
    ~Bill

  • Issue with getting handle to the swf object in a jsp

    Hi,
    I have a jsp file which has the <object> tag to include the Flex swf file on the jsp. I have certain functions exposed to javascript (using ExternalInterface.callback) that can be used in the jsp. But when I try to get the handle to the swf object using document[swfId] or window.document[swfId] or document.getElementById(swfId) ..it returns back NULL..
    This works on some browers and doesn't work on some. I even tried to reinstall my browser but in vain.
    Any someone provide me with some pointers on this ?

    Hi, Thanks for getting back with me.  I know exactly what you mean about  the "www" or "public" section of a server as I've seen that on other servers that I've worked on with DW.
    However, this is different and it doesn't appear to have one.  I've taken a screen shot below of what the server looks like.  I did it with FTP as I'm on another computer that does not have DW.  As you'll see there are actually 2 sites I need to get connected to to change the web pages with DW - "beta.----.gov" and "www.----.gov." That's pretty much how it is.  The beta one is what they want me to do is make the edits on a page in the beta site first and then show them.  Upon approval, I will then go into the live site (www) and duplicate what I did to make the changes live. So again, your screen shots seem to help (I won't know until tomorrow when I'm on the other computer in another building that has Dreamweaver on it to try to use your DW settings) but does this make sense?  Any other ideas that could be useful to get me up and running? Thanks.

  • Dynamic graphic in smartform with exception handle.

    Hi All,
    I have already created a graphic node in the PO Smartform which will display the buyer signature, i have uploaded some signatures graphics to the server and used the &PO-CREATED_BY& parameter in the general attributes of the node. The signature gets displayed fine if the graphic with the buyer's username as name exist.
    But what i'm looking for is: what to do if the graphic doesn't exist (the standard behavior is an error message and its not displaying the preview of the smartform). I would like to set a 'default' graphic (blank image) as the image is the user signature image doesn't exist, but i cannot find the place where i need to implement some logic to do that validation effort.
    I'll appreciate your comments rewarding points for useful answers.
    Regards,
    Gerardo.

    Hi,
    Check the table: STXBITMAPS for the graphics image what yuu are looking for.
    If it is existing, then write a SELECT query in code lines and store the value in a variable.
    [ Declare this in the Global definition part ].
    Then create a window to display the graphics image [ do not create a grpahics node] and add a ALTERNATIVE node.
    Here check the work area variable and put separate graphics in the True node and in the FALSE node.
    Hope this helps.
    Regards
    Subramanian

  • Pblm with exception handling

    when I enter an input 10a in the the dialogbox Enter monthly payment , it prompts me to enter a valid data. If I again enter 10a , actualy Enter valid data dialog box must be displayed.Instead it displays Enter monthly payment . Even if I enter 100 in Enter valid data dialog box, it again displays Enter monthly payment. I'v been try to fix this. Can anyone help me. Thanks
    import javax.swing.*;
    import java.text.*;
    public class TestTryCatch{
       public static void main(String[] args){
          String choice = "";
          boolean tryAgain = true;
          String string = "1";
          while (!(choice.equalsIgnoreCase("x"))){
                  while (tryAgain){
                       System.out.println("tryAgain before try :" + tryAgain);
                 try{
                         String paymentString = JOptionPane.showInputDialog(
                                                    null,
                                                         "Enter monthly payment: ",
                                                         "Future Value",
                                                     JOptionPane.PLAIN_MESSAGE);
                        double monthlyPayment = Double.parseDouble(paymentString);
                        //tryAgain = false;
                        paymentString = string;
                        monthlyPayment = Double.parseDouble(paymentString);
                        System.out.println("1");
                       /* Static method to validate monthlyPayment*/
                     if(monthlyPayment <=0)
                        validateMonthlyPayment(monthlyPayment);
                     String rateString = JOptionPane.showInputDialog(
                                             null,
                                             "Enter yearly interest rate: ",
                                             "Future Value",
                                             JOptionPane.PLAIN_MESSAGE);
                       double interestRate = Double.parseDouble(rateString);
                       //tryAgain=false;
                       System.out.println("2");
                         /* Static method to validate interestRate*/
                       interestRate = validateInterestRate(interestRate);
                       double monthlyInterestRate = interestRate/12/100;
                       String yearsString = JOptionPane.showInputDialog(
                                                 null,
                                                  "Enter number of years: ",
                                                  "Future Value",
                                               JOptionPane.PLAIN_MESSAGE);
                      int years = Integer.parseInt(yearsString);
                    years = validateYears(years);
                       int months = years * 12;
                       //tryAgain = false;
                       double futureValue = calculateFutureValue(monthlyPayment,
                                                                         months,
                                                                         monthlyInterestRate);
                         NumberFormat currency = NumberFormat.getCurrencyInstance();
                        NumberFormat percent = NumberFormat.getPercentInstance();
                        percent.setMinimumFractionDigits(2);
                        String message =
                                     "Monthly payment: " + currency.format(monthlyPayment) + "\n"
                                   + "Yearly interest rate: " + percent.format(interestRate/100) + "\n"
                                   + "Number of years: " +  years + "\n"
                                   + "Future value: " + currency.format(futureValue) + "\n\n"
                                   + "To continue, press Enter.\n"
                                   + "To exit, enter 'x': ";
                        choice = JOptionPane.showInputDialog(null,
                                                                      message,
                                                                     "Future Value",
                                                                     JOptionPane.PLAIN_MESSAGE);
                        System.out.println("choice is : " + choice);
                 } // end try loop
                    //tryAgain = false;
                       catch(NumberFormatException e){
                            string = JOptionPane.showInputDialog(
                                                              null,
                                                            "Enter a valid data: ",
                                                            "Future Value",
                                                          JOptionPane.PLAIN_MESSAGE);
                           /* String rateString = JOptionPane.showInputDialog(
                                                                  null,
                                                                 "Enter a valid interest rate: ",
                                                                 "Future Value",
                                                                JOptionPane.PLAIN_MESSAGE);
                           double validateRate = Double.parseDouble(rateString);
                           String yearsString = JOptionPane.showInputDialog(
                                                                   null,
                                                                  "Enter valid number of years " +"\n"+
                                                                  "between 0 to 100 : ",
                                                                  "Future Value",
                                                                  JOptionPane.PLAIN_MESSAGE);
                    int years = Integer.parseInt(yearsString);*/
                      } // end catch
                   }//end tryAgain
           } // end while loop
          System.exit(0);
       }//end main
       private static double calculateFutureValue(double monthlyPayment,
       int months, double interestRate){
          int i = 1;
          double futureValue = 0;
          while (i <= months) {
             futureValue = (futureValue + monthlyPayment) *
             (1 + interestRate);
             i++;
          return futureValue;
       } // end calculateFutureValue method
       private static void validateMonthlyPayment(double monthlyPayment){
          while(monthlyPayment <= 0) { // while loop to validate monthlyPayment
                  String paymentString = JOptionPane.showInputDialog(
                                                 null,
                                               "Enter a valid monthly payment: ",
                                               "Future Value",
                                             JOptionPane.PLAIN_MESSAGE);
                  monthlyPayment = Double.parseDouble(paymentString);
           } // end while loop monthlyPayment validation
       } // end validateMonthlyPayment
       private static double validateInterestRate(double validateRate){
          while(validateRate <= 0) { // while loop to validate interestrate
                  String rateString = JOptionPane.showInputDialog(
                                                null,
                                               "Enter a valid interest rate: ",
                                               "Future Value",
                                              JOptionPane.PLAIN_MESSAGE);
                  validateRate = Double.parseDouble(rateString);
          } // end while loop
          return validateRate;
       } // end validateInterestRate method
       private static int validateYears(int years){
              while(years <= 0 || years>= 100){
                  String yearsString = JOptionPane.showInputDialog(
                                                null,
                                               "Enter valid number of years " +"\n"+
                                               "between 0 to 100 : ",
                                               "Future Value",
                                             JOptionPane.PLAIN_MESSAGE);
             years = Integer.parseInt(yearsString);
          return years;
    }

    Too much code. Yo udon't need all that Swing stuff to see how to make this work.
    This works - see if you can adapt it:
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.IOException;
    public class TryAgainTester
        public static void main(String [] args)
            double payment      = 0.0;
            boolean tryAgain    = true;
            String entry        = "";
            while (tryAgain)
                try
                    System.out.print("Enter payment: ");
                    entry       = getString(System.in);
                    payment     = Double.parseDouble(entry);
                    tryAgain    = false;
                catch (NumberFormatException e)
                    System.err.println("Invalid entry: " + entry);
                    tryAgain = true;
                catch (Exception e)
                    e.printStackTrace();
            System.out.println("payment: " + payment);
        public static String getString(InputStream in) throws IOException
            String value = "";
            InputStreamReader isr = new InputStreamReader(in);
            BufferedReader br       = new BufferedReader(isr);
            value = br.readLine();
            return value;

  • Exception handling in App. package PeopleCode

    Hi,
    I am accessing a table that is on remote database using DBLink for an update/insert operation using SQLExec. I am trying to implement exception handling to account for the scenario where the remote database is offline so that transaction can continue. However when I use the try-catch block in the app. package PeopleCode somehow the processing does not seem to move forward from the error. The App. pacakage code is triggered by the handler of the service operation. The goal is to simply skip the SQLExec if the table is not available. I am not sure if there is any limitation to the fatal SQL errors which the try-catch can handle.
    As expected i get below error when running select on a view which has remote table in the SQL developer as remote database is down.
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    Has anyone enconutered similar issue with exception handling and best way to move forward in this scenario.
    Any response is much appreciated.
    Thanks,
    Gireesh

    I did this with PL/SQL once. Basically, you want to know if the remote database is available before you execute SQL against it. Here is my function. You can then SQLExec something like select 'x' from dual where my_package.link_available('the_link_name') = 1. If you get a result, then the db link is active. If you don't, it is not active.
    FUNCTION LINK_AVAILABLE(pv_name VARCHAR2)
      RETURN NUMBER AS
            lv_result PLS_INTEGER;
            lv_name   VARCHAR2(128);
        BEGIN
            lv_name := UPPER(pv_name);
            -- parameter check to avoid SQL injection with dynamic SQL below
            -- if the following selects no rows, it will fall through to exception
            -- and return 0;
            SELECT 1
              INTO lv_result
              FROM ALL_DB_LINKS
             WHERE DB_LINK = lv_name;
            -- if we made it this far, then the parameter was a valid db link name
            -- execute SQL to test
            EXECUTE IMMEDIATE 'SELECT 1 FROM PS_INSTALLATION@' || lv_name INTO lv_result;
            RETURN lv_result;
        EXCEPTION
            WHEN OTHERS THEN
                RETURN 0;
      END LINK_AVAILABLE;

  • Exception Handling with GUI

    Hi,
    I'm new to Java so I'm a little rusty with exception handling. Please help me with this portion of my code. I'm supposed to screen out the bad input by the user. The user has to enter a double value and not an illegal value, for example: 45ab would be unacceptable. I've tried this way but after entering a number, the program just exits. Thanks first for helping me out.
    import javax.swing.*;
    import java.io.*;
    import java.text.*;
    public class Circle {
    public static double readDouble() {
    boolean done = false;
    String s;
    double d=0;
    while (!done) {
    JOptionPane.showInputDialog("Enter a double : ");
    System.out.flush();
    try {
    BufferedReader in = new BufferedReader (
    new InputStreamReader(System.in));
    s = in.readLine();
    d = Double.parseDouble(s);
    d = new Double(s).doubleValue();
    done = true;
    }catch (IOException e){
    done = true;
    }catch (NumberFormatException e1){
    JOptionPane.showMessageDialog(null,"Error -- input a double -- Try again");
    return d;
    public static void area(){
    double radius1;
    double area;
    radius1 = readDouble();
    area = (radius1 * radius1) * Math.PI;
    // Rounding the area value to 2 decimal places
    NumberFormat nf = NumberFormat.getNumberInstance();
    nf.setMaximumFractionDigits(2);
    JOptionPane.showMessageDialog(null, "The area is " + nf.format(area));
    // There are more code after this.

    Hello, I quickly wrote a possible solution to your problem, hope it will help you. (ICQ #28985387)
    import javax.swing.*;
    public class InputExample {
    public static double getDouble() {
    String input;
    do {
    input = JOptionPane.showInputDialog(null, "Enter a double", "Input", JOptionPane.QUESTION_MESSAGE);
    } while(!validateDouble(input));
    return Double.parseDouble(input);
    private static boolean validateDouble(String input) {
    double num = 0;
    try {
    if(input.length() == 0) {
    JOptionPane.showMessageDialog(null, "Please enter a value", "Warning", JOptionPane.WARNING_MESSAGE);
    return false;
    num = Double.parseDouble(input);
    } catch(NullPointerException exception) {
    System.exit(0);
    } catch(NumberFormatException exception) {
    JOptionPane.showMessageDialog(null, "Not a double", "Warning", JOptionPane.WARNING_MESSAGE);
    return false;
    if (num < -Double.MAX_VALUE || Double.MAX_VALUE < num) {
    JOptionPane.showMessageDialog(null, "Must be between\n" + (-Double.MAX_VALUE) + "\nand " + Double.MAX_VALUE, "Warning", JOptionPane.WARNING_MESSAGE);
    return false;
    return true;
    }

  • Playback Issues with multiple framerates and Blackmagic Decklink 4K Extreme

    I recently swapped by AJA Kona Card for a Blackmagic Decklink 4K Extreme in order to get external monitoring in DaVinci Resolve.
    I'm working in a 1080p 23.976 project that includes some 29.97 SD and HD footage. When loading this 29.97fps footage into my source footage, I periodically encounter frozen playback (The play triangle in my toolbar becomes a square symbol and remains that way). From there I am unable to playback any footage in any timeline, and requires a full system shutdown to return to normal! The problem is seemingly intermitent, with successful playback happening sometimes.
    The 29.97 footage was DVCPRO, I attempted to transcode to Prores to troubleshoot. No dice. I believe it to be an issue related to the Decklink's inability to handle multiple framerates on-the-fly but wanted to submit here, too. I've also experienced intermittent sync delays on my broadcast monitor.
    Decklink Driver 10.0
    Premiere CC 7.2.1
    Mac OSX 10.9.2 (same problem pre-mavericks)

    Hi Andy,
    You should not have any issues with Blackmagic handling multiple formats on the fly. However, I believe the frozen playback issues your describing is related to the Desktop Video 10 driver. I suggest rolling back to 9.3.3 for the time being. Blackmagic is looking into this issue now.
    Best,
    Peter Garaway
    Adobe
    Premiere Pro

  • Exception handling for all the insert statements in the proc

    CREATE PROCEDURE TEST (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    if @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE [MONTH] BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND [YEAR] BETWEEN year(@StartDate) and year(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1
    A,B,C
    SELECT
    A,BC
    FROM XYZ
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT>0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    END--End of Main Begin
    I have the above proc inserting data based on parameters  where in @InsertCase  is used for case wise execution.
     I have written the whole proc with exception handling using try catch block.
    I have just added one insert statement here for 1 case  now I need to add further insert  cases
    INSERT INTO TAB4
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB3
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB2
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    I will be using following to insert further insert statements 
    if @InsertCase =1 
    I just needed to know where will be my next insert statement should be fitting int his code so that i cover exception handling for all the code
    Mudassar

    Hi Erland & Mudassar, I have attempted to recreate Mudassar's original problem..here is my TABLE script;
    USE [MSDNTSQL]
    GO
    /****** Object: Table [dbo].[TAB1] Script Date: 2/5/2014 7:47:48 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[TAB1](
    [COL1] [nvarchar](1) NULL,
    [COL2] [nvarchar](1) NULL,
    [COL3] [nvarchar](1) NULL,
    [START_MONTH] [int] NULL,
    [END_MONTH] [int] NULL,
    [START_YEAR] [int] NULL,
    [END_YEAR] [int] NULL
    ) ON [PRIMARY]
    GO
    Then here is a CREATE script for the SPROC..;
    USE [MSDNTSQL]
    GO
    /****** Object: StoredProcedure [dbo].[TryCatchTransactions1] Script Date: 2/5/2014 7:51:33 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[TryCatchTransactions1] (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    IF @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE START_MONTH BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND START_YEAR BETWEEN year(@StartDate) and YEAR(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1 (COL1,COL2,COL3)
    VALUES ('Z','X','Y')
    SELECT COL1, COL2, COL3
    FROM TAB1
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    PRINT @SUCCESSMESSAGE
    END--End of Main Begin
    GO
    I am just trying to help --danny rosales
    UML, then code

Maybe you are looking for