Sorting problem in 10g

dear all,
We have a new 10g database and have loaded a dump from 9i. We followed all procedures as written in documentations. The database is working fine but we experience one problem.
We connect to the database with our application that was developed in Powerbuilder. Reports we run from this database gives the same results as in 9i database except the records do not adhere to sorting condition given. Below is the example
in 9i report results
tax type          amount
Payee               1000
Corporate tax          200
Oil Levy          420
Withholding tax          80
Total               1,700
in 10g report results
tax type          amount
Oil Levy          420
Withholding tax          80
Corporate tax          200
Payee               1000
Total               1,700
Why the records are not arranged in the proper manner in 10g while the application used is the same?
Thanks and regards,
Steve

Thanks Peluka.
But even I don't enhance the vendor search help, I still found that the original standard version has this problem after sorting.
Is that the program bug?
Have anyone encountered this problem before?

Similar Messages

  • Sorting Problem in FND_MENU_ENTRIES_TL Table

    Hi,
    FND_MENU_ENTRIES_TL Table storing the record FND_MENU_ENTRIES_TL_N1(MENU_ID,PROMPT,LANGUAGE) wise in R12. But whereas in 11i, records stored FND_MENU_ENTRIES_TL_U1(MENU_ID,ENTRY_SEQUENCE,LANGUAGE).
    I am confused, whether i need to recreate the index in R12, so the records will get store MENU_ID,ENTRY_SEQUENCE,LANGUAGE wise.
    Could any one please suggest me how to resolve this problem.
    Thanks,
    Praba T

    815667 wrote:
    Hi,
    FND_MENU_ENTRIES_TL Table storing the record FND_MENU_ENTRIES_TL_N1(MENU_ID,PROMPT,LANGUAGE) wise in R12. But whereas in 11i, records stored FND_MENU_ENTRIES_TL_U1(MENU_ID,ENTRY_SEQUENCE,LANGUAGE).
    I am confused, whether i need to recreate the index in R12, so the records will get store MENU_ID,ENTRY_SEQUENCE,LANGUAGE wise.
    Could any one please suggest me how to resolve this problem.
    Thanks,
    Praba TPl do not abuse the forums by cross-posting in multiple forums
    Sorting Problem in FND_MENU_ENTRIES_TL Table
    Sorting Problem in FND_MENU_ENTRIES_TL Table
    Your issue is related to EBS, not to database upgrades (which is the topic of this forum)
    Srini

  • Sorting problems in Grid View

    Hi, I'm having a bit of a sorting problem when it comes to an artist with name variations. The example I'm going to use is DJ Tiesto.
    There are album I have where he is credited as DJ Tiesto, and others where he is simply Tiesto.
    In the end, I'd like these albums sorted chronologically under one name (say DJ Tiesto), while still preserving and showing the proper artist name for each album. I have it set to sort by "Album by Year", which is working fine.
    The major problem I am having is that I can't get it to display properly across all iTunes viewing methods: List mode, Grid mode, and Coverflow.
    I've tried leaving the Artist field alone, and changing the Sort Artist field to "DJ Tiesto" for all songs, and that almost works:
    -List mode groups them all under "DJ Tiesto", while showing each albums Artist as the correct artist name.
    -Grid mode sorted by Album groups them all under "DJ Tiesto", while showing each albums Artist as the correct artist name.
    -Coverflow sorts them all in chronological order, while showing each albums Artist as the correct artist name.
    Problem is, Grid mode sorted by ARTIST creates two separate artists! Some for DJ Tiesto and some for Tiesto!
    To correct this I tried changing the Album Artist field for all songs to "DJ Tiesto", which solved that problem but created a bunch of new ones:
    -List mode is still correctly grouping them under "DJ Tiesto", while showing each albums Artist as the correct artist name.
    -Grid mode sorted by Album is still correctly grouping them under "DJ Tiesto", *however now it is not displaying the correct Artist name for each album!*
    -Grid mode sorted by Artist is now grouping them all under "DJ Tiesto", *however it is not displaying the correct Artist name for each album!*
    -Coverflow is sorting them in correct chronological order, *however it as well is not displaying the correct Artist name for each album!*
    Using the Album Artist tag has created more problems that it has solved! Is there anyone who knows a way to achieve what I am trying to do? I have tried seemingly every option I can and have still not found a way to do this!!
    Thanks!

    My own method of working involves renaming the files upon import to:
    i "shotdate_sequencenumber"
    Files are therefore typically named
    b 2007-11-25_001
    etc.
    This way, sorting by Filename automatically sorts by Date by default. And it wouldn't even matter if you added a descriptive text in between the date and number (
    b 2007-11-25_Scotland_001

  • Sorting problem in standard vendor search help

    Hi all,
    I'm enhancing the vendor search help.
    I found that there is a sorting problem in the original standard search help.
    The 1st time to search vendor in the search help returns a correct list, then I just sort the vendor in ascending order. This time the column name of the hit list changes and mismatch the actual values.
    Any one faced this problem before?
    What's wrong are there ?
    Thanks.

    Thanks Peluka.
    But even I don't enhance the vendor search help, I still found that the original standard version has this problem after sorting.
    Is that the program bug?
    Have anyone encountered this problem before?

  • Catalog Migration Problem from 10g to 11g

    Hi,
    When i am trying to migrate catalog of 10g to 11g. They have some problems
    1. In obiee 10g (under root folder) it shows only around 5 dashboards. But actually when i am seeing in the I catalog manager of obiee 10g it shows 12 dashboards and pages.
    Can some please help me on this how to see the other dashboards and page in obiee 10g ( under root folder ).
    2. When i am trying to migrate the catalog folder in obiee 11g it also shows around 5 dashboards. And other dashboards are not seeing after migration.
    Can someone please help me on this how to see the other dashboards and pages in obiee 11g as well.

    Hi,
    In Webcat, there can be some contents that are inconsistent/invalid. And such contents have 0 byte size. Please check if dashboards files that are not visible and their corresponding .atr files have 0 byte size.
    Other possibility can be dashboards are hidden for the user-id you are using for login.
    Please mark as helpful/correct if this reply helps.
    Thanks,
    Vijay
    Edited by: user5814724 on Apr 8, 2013 4:58 AM

  • Ports problems with 10g XE

    Hello!
    I'm using Oracle 10g XE on Windows Server 2003, the installation was successfully realized.
    The problem is that I can't access to the login page : http://127.0.0.1:8080/apex . I think that the problem come from a port restriction (but I'm not sure!) : the 8080 port is certainely blocked, but I don't know how open it ...
    With Windows XP Pro, I had no problem ... ! Nevertheless I used the same anti-virus program with the same rules ... !
    Can someone help me please, I'm loosing my hair !!
    Thanks !

    Hello!
    I'm using Oracle 10g XE on Windows Server 2003, the installation was successfully realized.
    The problem is that I can't access to the login page : http://127.0.0.1:8080/apex . I think that the problem come from a port restriction (but I'm not sure!) : the 8080 port is certainely blocked, but I don't know how open it ...
    With Windows XP Pro, I had no problem ... ! Nevertheless I used the same anti-virus program with the same rules ... !
    Can someone help me please, I'm loosing my hair !!
    Thanks !

  • Problem Oracle 10g database Installation on Windows 2003 Server

    Hi All,
    I am trying to face some problem to install oracle 10g database on windows 2003 server with service pack 2. Once I start to installation it give me an error "Error in writing to directory 'c:\documents and settings\administrator\local settings\temp\orainstall2004xxx'. Please ensure that this directory is writable and has at least 45MB of disk space. Installation cannot continue"
    I double-insured that there is enough disk-space and I am also in the Administrators-Group.
    Please guide me for the above problem although I have done oracle 9i database installation with the same configuration.
    Regards
    Muhammad Shoaib

    898118 wrote:
    Hi All,
    I am trying to face some problem to install oracle 10g database on windows 2003 server with service pack 2. Once I start to installation it give me an error "Error in writing to directory 'c:\documents and settings\administrator\local settings\temp\orainstall2004xxx'. Please ensure that this directory is writable and has at least 45MB of disk space. Installation cannot continue"
    I double-insured that there is enough disk-space and I am also in the Administrators-Group.
    Please guide me for the above problem although I have done oracle 9i database installation with the same configuration.
    Regards
    Muhammad ShoaibOracle really doesn't like to be installed into directories with spaces in their names.

  • Problem with 10g and 9i in one machine

    Hello,
    I installed 10g in a pc where 9i is already installed. It was installed in its own home directory. My problem is that when I try to access it using Enterprise Manager, or Sql*Plus, or Developer, I get either the service name could not be resolved, or cannot allocate a dedicated server. The service is up and running.
    The curious thing is that I can access it with the command from a command window:
    sqlplus
    'scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=CAC403JN.EBOT.CA)(PO
    RT=1521)))(CONNECT_DATA=(ORACLE_SID=ANEC)))'
    Both the 9i and 10g have the same HOST and PORT but different SID.
    How do I fix my configuration so I can access 10g using the using tools?
    Help.
    Thanks,
    gk

    If you are using local naming (tnsnames.ora file) and you have multiple Oracle Homes, one of two things has to happen
    1) Every TNS entry has to be duplicated in each tnsnames.ora file.
    2) You need to create a TNS_ADMIN environment variables that points at the location of the single tnsnames.ora file that all applications should use.
    My personal preference is to go with option 2.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Sort problem in a report

    Hi,
    I'm using the sort on a report with 7 columns. For each column I've specified
    the sort sequence from 1 to 7. The last sort is a date field. If i sort now the
    last column and i change to next report side the sort change jump to the first column.
    Is there somebody who had also a problem like this?
    Greets,
    Tom

    You can check boxes to determine which columns can be sorted; if you check one or more boxes, you also need to set the "Sort Sequence" attribute under the "Report Attributes" tab of your SQL query region. So to use sorting you must.
    1. ensure you don't have an order by in your SQL statement
    2. check one or more "sort" boxes
    3. set the default order in one or more column in the "sort sequence" column
    Hope this helps,
    Mike

  • Sorting Problem in XML Publisher Report

    Dear Members,
    I am facing problems with sorting data in my XML Publisher Report.
    We are using Oracle E-Business Suite 12.1 Version and i developed a rtf Template and executable is an RDF which generates XML Data.
    I want the whole report to group by element ITEM_NAME which is a character in the ascending order. I tried several ways but it is not working properly.
    I don't know how to upload the RTF template in this forum. I tried to post the XML Code and since its excceds 30000 characters i cant post it in the forum.
    Any help is greatly appreciated.
    Thanks
    Sandeep

    You can't upload the template here; you can post a part of the relevant XML code and template code here.
    or send me a sample XML and RTF template to [email protected] and I will take a look.

  • Mail sorting problem after upgrading to Mountain Lion?

    I have a strange problem with Mail after upgrading to Mountain Lion.
    Before upgrading, when I tried to search my Mail Inbox for e-mails from a specific sender, the esearch results would be indexed by the name of the sender. For example: when I entered 'John Smith' in the search box in Mail, it would display a list of email from 'John Smith'
    Now after upgrading, the same query indexes the search results by the 'To' address i.e. my email address.For example: if my name is 'Steve Johnson', a search for 'John Smith' in the search box in Mail displays a list of email to 'Steve Johnson' and not from 'John Smith' which is how it used to display before.
    My emails are sorted by Date always, and I am using the default Mail view [not classic view]
    Can someone please help with a fix for this to help me get back to the original display I had while searching? Thanks in advance.

    I'm having the same problem.  It's incredibly annoying!!!  Did you find an answer?

  • DBLinks Problem in 10g Release 2

    I have many mappings taking data from tables in a remote database asociated with a Source Database module. All was working OK but after some changes in one mapping, when I triyed to deploy that mapping I got a warning in the Control Center's Job Details:
    GNV_MP_B_VENTAS_01_PKG
    Warning
    ORA-06550: line 222, column 7:
    PL/SQL: SQL Statement ignored
    GNV_MP_B_VENTAS_01_PKG
    Warning
    ORA-06550: line 264, column 23:
    PL/SQL: ORA-00942: table or view does not exists
    Checking for errors in the package GNV_MP_B_VENTAS_01_PKG I've found the following message in compilation errors:
    Error(1):
    ORA-04052: se ha producido un error al consultar el objeto remoto [email protected]@SOU_GNVBI_LOCATION1
    ORA-00604: se ha producido un error a nivel 1 de SQL recursivo
    ORA-01882: timezone region not found
    ORA-02063: line....
    Testing the DBLink created by OWB I have the followiong message:
    SQL > select * from dual@"GASN.REGRESS.RDBMS.DEV.US.ORACLE.COM@SOU_GNVBI_LOCATION1"
    Error starting at line 1 in command:
    select * from dual@"GASN.REGRESS.RDBMS.DEV.US.ORACLE.COM@SOU_GNVBI_LOCATION1"
    Error at Command Line:1 Column:19
    Error report:
    SQL Error: ORA-01882: timezone region not found
    ORA-02063: line precediendo a GASN@SOU_GNVBI_LOCATION1
    01882. 00000 - "timezone region %s not found"
    *Cause:    The specified region name was not found.
    *Action:   Please contact Oracle Customer Support.
    Can anyone help me with this issue ? This is my config info:
    Remote DB:
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    PL/SQL Release 9.2.0.4.0 - Production
    "CORE     9.2.0.3.0     Production"
    TNS for Linux: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 – Production
    OWB's DB:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    "CORE     10.2.0.3.0     Production"
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 – Production
    OWB 10.2 Release 2
    Client. 10.2.0.3.33
    OWB Repository: 10.2.0.30

    Right Now we are seting up the Timezone patch y the 9i database. I'll tell you later how goes all the process but meanwhile here are some strange things about the ORA-01882 error:
    I've tested the DBLink using Oracle SQL Developer an it doesn't work. But if I test the same DBLink using SQL*Plus (no matter client version or platfom) it works...
    I realize that when I created a new DBLink via SQL*Plus to determine if the problem was related to OWB 10.2. Running OWB 10.2 client from Windows or Linux produces the same error in deploy. Testing the BDLink from SQL*Plus from Windows or Linux produces no errors. Althought I can't recompile the package generated when the mapping was deployed, I get the same ORA-04052 - ORA-00604 - ORA-01882 errors.
    When I completed the patch installation I will tell you the results...

  • Help with Artist Sort Problem Needed...

    This is a bit long, so I'll start with the three main questions and below them is the backstory and detail of the problem (I did do a search but nothing turned up):
    1) Does anyone know how to fix artist sorting issues where the artists are properly sorted (alphabetically by last name and band name) but there are constant grey-bar letter headings for the first name (sorry...I don't know how to explain better than I do below in detail)
    2) Will re-setting the Touch require I have to...
    a) re-add all the songs I've manually selected again
    b) re-input any data saved to apps (such as CarCare and
    Pocketpedia) and if so, can I backup that data first?
    3) If all the re-doing in 2 above is necessary if I were to re-set the iPod, can anyone think of an alternative fix that would avoid a reset?
    I might be able to get to an Apple store this weekend to ask a "genius" but I'm not that confident in them since I was given some incorrect information on how the Touch handles playlists at the time of original purchase.
    Okay... now, what happened:
    I'm not sure what to make of this, fortunately playback and all main functions are unaffected. I have my iPod Touch 2g set for manual sync. Today, while I was charging it at work, my PC (WinXP) froze. I gave it plenty of time to unfreeze, but eventually had no choice but to do a hard reboot while the iPod said "syncing." I slid the slider to cancel the sync, but the iPod didn't respond. I unhooked it from the PC and it unfroze. I shut it down and re-started.
    Everything seemed fine after the iPod reboot except that now, while the artists are still sorted alphabetically (I've manually set artists to sort by last name), there are headers using the first letter of the first name between each artist. So, for instance, this is how the top of my artist list looks now (lines below with just a letter are the grey divider bar with the alphabetical header):
    R
    Ryan Adams
    D
    Dave Alvin
    T
    Tori Amos
    E
    Eric Andersen
    A
    Apples in Stereo
    Arcade Fire
    L
    Louis Armstrong
    A
    Ataris
    ...etc.
    This problem has not extended to album or song title fields, but for some reason, when scrolling through the album view using the index on the right, it moves fine until "O" -- then it sits still as I scroll down until it gets to "#", at which point it's resposnive again.
    I've checked the music library on the iPod via iTunes and the artist sort fields are still correct.
    Suggestions? I'm new to the Touch and am leery of doing a reset yet since it's taken time to figure out which songs from my 100+gb library to manually put on this. Also, I have no idea how it will affect the apps I've downloaded. There are some where I've saved data (such as CarCare and Pocketpedia) and I REALLY don't want to risk having to re-input all that data.
    To anyone with any words of advice, thanks in advance.
    Message was edited by: IronWaffle
    Message was edited by: IronWaffle

    This is an answer to only qestion 2. Yes restoring your ipod will delete all songs, apps, videos, etc., but you can back up settings like a passcode lock or screen brightness. But it will ask if you want to back up settings. If your'e on windows, in itunes go to file and down almost all the way you will see a "Tranfer purchases from (ex.) steves ipod" and that will make sure you have all your apps and music and other stuff.

  • JTable sorting - problem when adding elements (complete code inside)

    I�m writing this email with reference to a recent posting here but this time with the code example. (I apologize for the duplicated posting � this time it will be with the code)
    Problem: when adding more elements to the JTable (sorted) the exception: ArrayIndexOutOfBoundsException is thrown.
    Example: If the elements in the table are 10 and then the user requests for 8 � the table will produce the correct result. However, if the user will ask for 11 items (>10) the exception will be thrown.
    The program: The program below (compiles and running). A JTable is constructed with 3 items, when you click the button - the return result should be 4 items - this will generate the error, WHY?
    I would highly appreciate your thoughts why this is happening and most importantly � how to fix it.
    Thanks a lot
    3 files:
    (1) TableSorterDemo
    (2) Traveler
    (3)TableSorter
    //TableSorterDemo:
    package sorter;
    import javax.swing.DefaultListModel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    * TableSorterDemo is like TableDemo, except that it
    * inserts a custom model -- a sorter -- between the table
    * and its data model.  It also has column tool tips.
    public class TableSorterDemo implements ActionListener
         private JPanel superPanel;
         private JButton clickMe = new JButton("click me to get diff data");
         private boolean DEBUG = false;
         private DefaultListModel defaultListModel;
         private JTable table;
        public TableSorterDemo()
             superPanel = new JPanel(new BorderLayout());
             defaultListModel = new DefaultListModel();
             init1();
            TableSorter sorter = new TableSorter(new MyTableModel(defaultListModel)); //ADDED THIS     
            table = new JTable(sorter);             //NEW
            sorter.setTableHeader(table.getTableHeader()); //ADDED THIS
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Set up tool tips for column headers.
            table.getTableHeader().setToolTipText(
                    "Click to specify sorting; Control-Click to specify secondary sorting");
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            superPanel.add("Center", scrollPane);
            superPanel.add("South",clickMe);
            clickMe.addActionListener(this);              
        public JPanel getPanel()
             return superPanel;
        public void init1()
             //in real life this will be done from the db
             Traveler a = new Traveler();
             Traveler b = new Traveler();
             Traveler c = new Traveler();
             a.setFirstName("Elvis");
             a.setLastName("Presley");
             a.setSprot("Ping Pong");
             a.setNumYears(3);
             a.setVegetarian(true);
             b.setFirstName("Elton");
             b.setLastName("John");
             b.setSprot("Soccer");
             b.setNumYears(2);
             b.setVegetarian(true);
             c.setFirstName("shaquille");
             c.setLastName("oneil");
             c.setSprot("Golf");
             c.setNumYears(22);
             c.setVegetarian(true);
             defaultListModel.addElement(a);
             defaultListModel.addElement(b);
             defaultListModel.addElement(c);
        public void init2()
             //in real life this will be done from the db
             Traveler d = new Traveler();
             Traveler e = new Traveler();
             Traveler f = new Traveler();
             Traveler g = new Traveler();
             d.setFirstName("John");
             d.setLastName("Smith");
             d.setSprot("Tennis");
             d.setNumYears(32);
             d.setVegetarian(true);
             e.setFirstName("Ron");
             e.setLastName("Cohen");
             e.setSprot("Baseball");
             e.setNumYears(12);
             e.setVegetarian(true);
             f.setFirstName("Donald");
             f.setLastName("Mac Novice");
             f.setSprot("Vallyball");
             f.setNumYears(1);
             f.setVegetarian(true);
             g.setFirstName("Eithan");
             g.setLastName("Superstar");
             g.setSprot("Vallyball");
             g.setNumYears(21);
             g.setVegetarian(true);
             defaultListModel.addElement(d);
             defaultListModel.addElement(e);
             defaultListModel.addElement(f);
             defaultListModel.addElement(g);            
        class MyTableModel extends AbstractTableModel
             private DefaultListModel myModel;
             public MyTableModel(DefaultListModel m)
                  myModel=m;
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            public int getColumnCount()
                return columnNames.length;
            public int getRowCount()
                return myModel.size();
            public String getColumnName(int column)
                 return getNames()[column];             
             public String[] getNames()
                  String[] names = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
                  return names;
            public Object getValueAt(int row, int col)
                 return distributeObjectsInTable(row, col, (Traveler) myModel.elementAt(row));
            public Object distributeObjectsInTable(int row, int col, Traveler tr)
               switch(col)
                         case 0:
                              return tr.getFirstName();
                         case 1:
                           return tr.getLastName();
                      case 2:
                           return tr.getSprot();
                      case 3:
                           return new Integer(tr.getNumYears());
                      case 4:
                           return new Boolean (tr.isVegetarian());
                     default:
                         return "Error";
            public Class getColumnClass(int c)
                return getValueAt(0, c).getClass();
        private static void createAndShowGUI()
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableSorterDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableSorterDemo newContentPane = new TableSorterDemo();
            newContentPane.getPanel().setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane.getPanel());
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args)
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable()                   
                public void run()
                    createAndShowGUI();
         public void actionPerformed(ActionEvent ae)
              if (ae.getSource()==clickMe)
                   defaultListModel.removeAllElements();
                   init2(); //if the size of the model was less than 2 items - the result will be ok.
                              //in other words, if you commens the last 2 rows of this method (addElement(f) & g)
                             // the result will be fine.
                   table.updateUI();          
    }//(2) Traveler
    package sorter;
    public class Traveler
         private String firstName;
         private String lastName;
         private String sprot;
         private int numYears;
         private boolean vegetarian;
         public String getFirstName()
              return firstName;
         public String getLastName()
              return lastName;
         public int getNumYears()
              return numYears;
         public String getSprot()
              return sprot;
         public boolean isVegetarian()
              return vegetarian;
         public void setFirstName(String firstName)
              this.firstName = firstName;
         public void setLastName(String lastName)
              this.lastName = lastName;
         public void setNumYears(int numYears)
              this.numYears = numYears;
         public void setSprot(String sprot)
              this.sprot = sprot;
         public void setVegetarian(boolean vegetarian)
              this.vegetarian = vegetarian;
    }//(3)TableSorter
    package sorter;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    public class TableSorter extends AbstractTableModel {
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator() {
            public int compare(Object o1, Object o2) {
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator() {
            public int compare(Object o1, Object o2) {
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter() {
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel) {
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader) {
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState() {
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel() {
            return tableModel;
        public void setTableModel(TableModel tableModel) {
            if (this.tableModel != null) {
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null) {
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader() {
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader) {
            if (this.tableHeader != null) {
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer) {
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null) {
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer(
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer()));
        public boolean isSorting() {
            return sortingColumns.size() != 0;
        private Directive getDirective(int column) {
            for (int i = 0; i < sortingColumns.size(); i++) {
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column) {
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column) {
            return getDirective(column).direction;
        private void sortingStatusChanged() {
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null) {
                tableHeader.repaint();
        public void setSortingStatus(int column, int status) {
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE) {
                sortingColumns.remove(directive);
            if (status != NOT_SORTED) {
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size) {
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE) {
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting() {
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator) {
            if (comparator == null) {
                columnComparators.remove(type);
            } else {
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column) {
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null) {
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType)) {
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel() {
            if (viewToModel == null) {
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++) {
                    viewToModel[row] = new Row(row);
                if (isSorting()) {
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
            return getViewToModel()[viewIndex].modelIndex;
        private int[] getModelToView()
            if (modelToView == null) {
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++) {
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount() {
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount() {
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column) {
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column) {
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column) {
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column) {
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column) {
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable {
            private int modelIndex;
            public Row(int index) {
                this.modelIndex = index;
            public int compareTo(Object o) {
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();) {
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null) {
                        comparison = 0;
                    } else if (o1 == null) {
                        comparison = -1;
                    } else if (o2 == null) {
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0) {
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener {
            public void tableChanged(TableModelEvent e) {
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting()) {
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null) {
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter {
            public void mouseClicked(MouseEvent e) {
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1) {
                    int status = getSortingStatus(column);
                    if (!e.isControlDown()) {
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon {
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority) {
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y) {
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth() {
                return size;
            public int getIconHeight() {
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer {
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column) {
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive {
            private int column;
            private int direction;
            public Directive(int column, int direction) {
                this.column = column;
                this.direction = direction;
    }

    The table listens to the TableModel for changes. Changing the table by adding/removing
    rows or columns has no affect on its table model. If you make changes to the table model
    the table will be notified by its TableModelListener and change its view. So tell
    MyTableModel about the change of data:
    public class TableSorterDemo implements ActionListener
        MyTableModel tableModel;
        public TableSorterDemo()
            defaultListModel = new DefaultListModel();
            init1();
            tableModel = new MyTableModel(defaultListModel);
            TableSorter sorter = new TableSorter(tableModel);
        public void actionPerformed(ActionEvent ae)
            if (ae.getSource()==clickMe)
                defaultListModel.removeAllElements();
                init2();
                tableModel.fireTableStructureChanged();
    }

  • Problems installing 10G (r 10.2) on Windows 7 64-bit

    Hello. I am taking an introductory Oracle SQL class. The professor gave us a link to install Oracle 10g release 2, which I followed and performed on my Windows 7 64-bit laptop. The installation seemed to run through okay. When asked (again, per instruction), I created a database named CIS276 (the class name) instead of "orcl" as suggested during the setup. I am having problems getting connected to the database, however, and since the class is online, I can't go to our campus to sit down with the professor to work out where the trouble is, so I'm hoping somebody out here can help me. Here's where I am:
    I am able to get to the Enterprise Manager through the loopback address and port that was given to me during installation. I am able to log into EM using the SYS account with the password I entered during install. I get to a screen that has a button labelled "Startup/Shutdown." When I click that button, I am taken to a screen asking for Host credentials (OS account name and password) and database credentials (I use "SYS", the password I created, database is already filled in, and "SYSDBA" for "Connect as"). After entering this information, I click on OK. I get an error message at the top of the screen saying: "Couldnot contact the agent. Verify that the url for the agent is null." I looked up this string and a suggestion was to run " lsnrctl status"--I think (I've been trying a lot of things over the past couple of days to try to get this running) and the program replied that the environment variable "ORACLE_SID" wasn't set. I looked up what I was supposed to do and went into Windows 7 Environment area and set the value.
    I rebooted the computer and tried again and am still getting the same problem. So I Googled the error message again and saw a suggestion to stop and restart dbconsole. When I did that, I got an error (stopping and starting) telling me that I was denied access.
    At this point, I felt I'd better stop and get any suggestions from more experienced Oracle users. If anybody could give me some suggestions as to what to try next, I'd truly appreciate it.
    And one other question: when I followed the link to download Oracle, there was another download listed called something like "Companion Disk 2". Is this a necessary download or is it just extra stuff that I may not use for now?
    Thank you again.
    Eric S. Bauman

    Hi Eric,
    I thin your problem is not related to Operating System. Right now I also use Windows 7 64 bit. and the oracle database that i used is Oracle 10g (10.2.0.3) for windows vista 64 bit. still up and running good.
    "I am able to get to the Enterprise Manager through the loopback address and port that was given to me during installation. I am able to log into EM using the SYS account with the password I entered during install. I get to a screen that has a button labelled "Startup/Shutdown." When I click that button, I am taken to a screen asking for Host credentials (OS account name and password) and database credentials (I use "SYS", the password I created, database is already filled in, and "SYSDBA" for "Connect as"). After entering this information, I click on OK. I get an error message at the top of the screen saying: "Couldnot contact the agent. Verify that the url for the agent is null." I looked up this string and a suggestion was to run " lsnrctl status"--I think (I've been trying a lot of things over the past couple of days to try to get this running) and the program replied that the environment variable "ORACLE_SID" wasn't set. I looked up what I was supposed to do and went into Windows 7 Environment area and set the value."
    from your problem let's do it one by one:
    to run lsnrctl, from windows desktop--> click start menu -> on search program and files box type cmd, the start menu will change its appearance and it will show you black icon with names cmd.exe do right click on that icon then choose run as administrator. It will open DOS command prompt for you.
    on DOS prompt type : set ORACLE_SID=<your database name>, example : set ORACLE_SID=orcl then enter
    now you can execute your lsnrctl status from the prompt.
    in case you need to start listener you can use : lsnrctl start from previous DOS Prompt or you can start it via services.msc as follow : from windows desktop--> click start menu -> on search program and files box type services.msc then enter on window that open find oracle<oracle_home>TNS listener services then double click this services click on button start.
    as for the agent problem is not running try to check the services with names oracleDBConsole<dbname> is it run or not.
    hope it helps.

Maybe you are looking for