Very dificult query for me- need help

I have table first column is time( Timestamp) ,
second column is record_num( int )
Now I need get data table for every day 8:00am to previous day 20:00pm, sum(record_num).
How can I do the query.
Thanks for your time and help
original table like
time record_num
03 27 2006 07:32:03 2
03 27 2006 06:20:08 5
03 26 2006 23:30:01 1
03 26 2006 20:00:01 7
03 25 2006 23:00:20 7
wanted query result table
03 27 2006 1234
03 26 2006 3452
or only 1234, 3452......
since I need avg( )
Thanks again

I am not sure exactly what you want, but it seems that if a record has a time after 22:00 then it should be included on the next day. And any records that are not between 8:00am and 8:00pm on the previous day should not be reported on. Is this what you are after?
Here is some code to achieve that:
control@DWDEV> create table my_data (my_time timestamp, my_value number);
Table created.
control@DWDEV>
control@DWDEV> -- This row should be included as it is at 1:00am
control@DWDEV> insert into my_data values (to_date('20060328010000','YYYYMMDDHH24MISS'), 1000);
1 row created.
control@DWDEV> -- This row won't be included because it is at 9:00am and not between 8am and 8pm on previous day
control@DWDEV> insert into my_data values (to_date('20060328090000','YYYYMMDDHH24MISS'), 2000);
1 row created.
control@DWDEV> -- This row should be included on the 29th because it is at 10:00pm on previous day
control@DWDEV> insert into my_data values (to_date('20060328220000','YYYYMMDDHH24MISS'), 3000);
1 row created.
control@DWDEV> -- This row should be included on the 29th because it is at 07:00am on same day
control@DWDEV> insert into my_data values (to_date('20060329070000','YYYYMMDDHH24MISS'), 400);
1 row created.
control@DWDEV> -- This row won't be included due to the time of 1:00pm
control@DWDEV> insert into my_data values (to_date('20060328130000','YYYYMMDDHH24MISS'), 600);
1 row created.
control@DWDEV>
control@DWDEV> select from8to8, sum(my_value)
  2  from
  3  (
  4     select case
  5               when to_char(my_time, 'HH24') >= 20
  6                  then to_char(my_time + 1, 'DD-MON-YYYY')
  7               when to_char(my_time, 'HH24') < 8
  8                  then to_char(my_time, 'DD-MON-YYYY')
  9               else
10                  NULL
11            end as from8to8,
12            my_value
13     from   my_data
14     where  to_char(my_time, 'HH24') < 8
15     or     to_char(my_time, 'HH24') >= 20
16  )
17  group by from8to8;
FROM8TO8    SUM(MY_VALUE)
28-MAR-2006          1000
29-MAR-2006          3400Hope that gives you a few ideas on how to achieve what you need.
Cheers,
Jeff.

Similar Messages

  • Executing the saved query for views -Need Help

    How can i run get the query for the saved search in views and execute it to view the results ?Can some one help on this pl
    Thanks!

    Hi,
    I am not able to get your requirement. Share in little details.
    As of my understanding, you want to get the query which is being executed.
    Regards,
    Gyan

  • Power Query for Excel - Need Help with Oracle SQL Syntax

    Hello everyone,
    I am new to Power Query and am not able to figure this out.  I am trying to pull in data into my Excel spreadsheet using a specific Oracle SQL query.  While in query editor, how do I take the Oracle.Database function and add my SQL statement? 
    I already know what I want, I don't want it to download all the table names.  According to the help page, I should be able to do this but it does not provide a syntax example
    Also, I don't understand what "optional options as nullable record" means.
    Below is what function and arguments the help page notes.  How do I use this?
    Oracle.Database(server as text, optional options as nullable record) as table
    Any help is greatly appreciated.
    Thank you,
    Jessica

    When I try this, I get an error 
    DataSource.Error: Oracle: Sql.Database does not support the query option 'Query' with value '"Select * from Owner.View_Name"'. Details: null
    I'm trying to download oracle data from a view into power query - Power Query navigator does not list th eviews from my source, it lists only the tables. When I try write sql statements, it throws me the above
    error. This is what I tried
     Oracle.Database("Source/Service",[Query="Select * from Owner.View_Name"])
    Any ideas how to fix this? 

  • JPQL Query for specific usecase, help needed

    Does anyone knows how to write the JPQL query for this specific use case.
    Take 3 tables,
    Table 1 contains bids for many auctions (Bid table)
    Table 2 Contains many auctions (Auction Table)
    Table 3 contains many users (User Table)
    I need a query to retrieve all the highest bids per auction for a particular user.
    For example if the user has bidded on 10 auctions., but for each auctions has placed 3 bids each. Following the query, I would expect to get 10 bids back, each being the highest per auction.
    A Bid has a bid value that can be used for filtering.
    Thanks
    Peter

    It would be something like the JPQL version of 'select * from bids join auctions using (auction_id) where bids.userid = ? group by auctions.auction_id order by bids.amount desc'. But this is primarily an SQL question, and only secondarily a question as to how to translate that into JPQL, which should be straightforward.

  • Warning this is very long code but i need help to see if I am on right trac

    I have done all the following code myself and it is the buisiness layer for my application. I have tried to follow recommendations on previous posts and I would like to be told where I can clean up my code and how? This is not complete and it looks very long to me but I need help in order to be better. There are 4 button vlivks and I have not completed them all. The criteria for application is that phonebook will accept new entries if they have names surnames and phone numbers that are not longer than 10 characters for display purposes but can change this. No duplicates are allowed. No editing of a existing entry must lead to a duplicate entry either. No new entry or edit may result in a new contact having no phone numbers.
    Many thanks for your time in advance,.....
    import javax.swing.JOptionPane;
    import java.util.ArrayList;
    public class Contact
    {// Start of the Contact class
         ArrayList<ContactDetails> phoneList = new ArrayList<ContactDetails>();          // To hold all the contacts
         ArrayList<ContactDetails> searchList = new ArrayList<ContactDetails>();          // To hold all contacts that return true on search
         ArrayList<ContactDetails> list = new ArrayList<ContactDetails>();
         String newName;                                                                                // To hold the new name
         String newSurname;                                                                           // to hold the new surname
         String newHome;                                                                                // To hold the new home number if any
         String newWork;                                                                                // To hold the new work number
         String newCell;                                                                                // To hold the new cell number
         final int MAX_LENGTH = 10;
         public boolean addToPhoneList;                                                            // Sets to false if there is an invalid entry
         public boolean addToSearchList;                                                            // Sets to false if there is an invlid search
         public boolean modifyContact;                                                            // Sets to false if there is an invalid modification
         // Method to create a new contact
         public void createNew()
         {// Start of create new()
              addToPhoneList = true;                                                                 // Set boolean to true each time the method is executed
              getNewContactsName();                                                                 // Get new name
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsSurname();                                                            //Get new surname
              if(addToPhoneList == false)
                   createNew();
                   return;
              String checkName = newName;                                                            //Creates copies to be used in the checkIfDuplicate method
              String checkSurname = newSurname;
              addToPhoneList = checkIfDuplicate(checkName, checkSurname);                    //Check if the entries are duplicate
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsHomeNum();                                                            // Get new home number
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsWorkNum();                                                            // Get new work number
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsCellNum();                                                            // Get new cell number
              if(addToPhoneList == false)
                   createNew();
                   return;
              checkAtLeastOneNumEntered();                                                       // Check that at least one phone number was entered
              if(addToPhoneList == true)
                   updateListWithNew();
         }// End of createNew()
         // Method to search for an existing contact
         public void searchExisting()
         {// Start of searchExisting()
              addToSearchList = true;                                                                 // Set the boolean true
              searchList.clear();                                                                      // Clear list from any previous searches
              if(phoneList.size() > 0)                                                            // Check if any contacts are in the list
                   getExistingDetailsAndSearch();                                                  // If there are entries then continue to search
              else
                   JOptionPane.showMessageDialog(null,"There are no contacts to search for. Please use this option when you have added a contact to the list.","Error",JOptionPane.ERROR_MESSAGE);
         }// End of searchExisting()
         // Method to modify an existing contact
         public void modifyExisting()
         {// Start of modifyExisting()
              modifyContact = true;                                                                 // Set the boolean to true
              if(phoneList.size() <= 0)                                                            // Check if the phonelist is not empty
                   JOptionPane.showMessageDialog(null,"There are no contacts to modify. Please use this option when there have been contacts added to the list.","Error",JOptionPane.ERROR_MESSAGE);
              else
                   getExistingDetailsAndModify();                                                  // If phonelist not emty continue to modify method
         }// End of modifyExisting()
         //Method to delete a contact from the list
         public void deleteExisting()
         //Method to get new contacts name
         public void getNewContactsName()
              newName = JOptionPane.showInputDialog("Please enter the new contacts name or press cancel to exit without saving.");
              if(newName == null)
                   finish();
              if(newName.trim().length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                   addToPhoneList = false;
                   return;
              addToPhoneList = checkLengthValid(newName, "name");
         //Method to get a new contacts surname
         public void getNewContactsSurname()
              newSurname = JOptionPane.showInputDialog("Please enter the new contacts surnname or press cancel to exit without saving.");
              if(newSurname == null)
                   finish();
              addToPhoneList = checkLengthValid(newSurname, "surname");
         //Method to get a new contacts home number
         public void getNewContactsHomeNum()
              newHome = JOptionPane.showInputDialog("Please enter the new contacts home number or press cancel to exit without saving.");
              if(newHome == null)
                   finish();
              if(newHome.trim().length() > 0)
                   try
                        Long homeNum = Long.parseLong(newHome);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid phone number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newHome, "home number");
         //Method to get a new contacst work number
         public void getNewContactsWorkNum()
              newWork = JOptionPane.showInputDialog("Please enter the new contacts work number or press cancel to exit without saving");
              if(newWork == null)
                   finish();
              if(newWork.trim().length()> 0)
                   try
                        Long workNum = Long.parseLong(newWork);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newWork, "work number");
         //Method to get a new contacts cell number
         public void getNewContactsCellNum()
              newCell = JOptionPane.showInputDialog("Please enter the new contacts cell number or press cancel to exit without saving");
              if(newCell == null)
                   finish();
              if(newCell.trim().length() > 0)
                   try
                        Long cellNum = Long.parseLong(newCell);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newCell, "cell number");
         //Method to get the details for an existing contact
         public void getExistingDetailsAndSearch()
              String existingName = getExistingName("search for");
              if(existingName == null)
                   addToSearchList = false;
                   return;
              if(existingName.length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
                   addToSearchList = false;
                   searchExisting();
              String existingSurname = getExistingSurname();
                   if(existingSurname == null)
                        return;
              if(addToSearchList == true)
                   searchAndAddIfFound(existingName, existingSurname);
         //Method to get existing details and modify contact
         public void getExistingDetailsAndModify()
              String existingName = getExistingName("modify");
              if(existingName == null)
                   modifyContact = false;
                   return;
              if(existingName.length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
                   modifyContact = false;
                   modifyExisting();
              String existingSurname = getExistingSurname();
                   if(existingSurname == null)
                        return;
              if(modifyContact == true)
                   getContactBySearch(existingName.trim().toUpperCase(), existingSurname.trim().toUpperCase());
         //Method to get the contact from list and modify details
         public void getContactBySearch(String currentName, String currentSurname)
              int count = 0;
              int numFound = 0;
              for(ContactDetails cd: phoneList)
                   cd = phoneList.get(count);
                   if((cd.name.equals(currentName))&&(cd.surname.equals(currentSurname)))
                        numFound ++;
                        changeDetails(cd);
                   count ++;
              if(numFound <= 0)
                   JOptionPane.showMessageDialog(null,"No contacts matching the name and surname you entered found. Press the modify button to try again.","Information",JOptionPane.INFORMATION_MESSAGE);
         //Method to get existing contacts name
         public String getExistingName(String whatWasClicked)
              String name = JOptionPane.showInputDialog("Please enter the contacts name that you wish to "+whatWasClicked);
              return name;
         //Method to get an existing contacts surname
         public String getExistingSurname()
              String surname = JOptionPane.showInputDialog("Please enter the contacts surname.");
              return surname;
         //Method to change the details of contact
         public void changeDetails(ContactDetails conToChange)
              String currentName = conToChange.name;
              String currentSurname = conToChange.surname;
              String currentHome = conToChange.home;
              String currentWork = conToChange.work;
              String currentCell = conToChange.cell;
              String newNameForContact = getNewModName(currentName);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newSurnameForContact = getNewModSurname(currentSurname);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newHomeForContact = getNewModHome(currentHome);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newWorkForContact = getNewModWork(currentWork);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newCellForContact = getNewModCell(currentCell);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              if(modifyContact == true)
                   conToChange.name = newNameForContact;
         //Method to get the modified name
         public String getNewModName(String currentName)
              String newModifiedName = JOptionPane.showInputDialog("Please enter the new name for contact or press cancel to keep it as is.");
              if(newModifiedName == null)
                   return currentName;
              if(newModifiedName.trim().length() <= 0)
                   JOptionPane.showMessageDialog(null,"You may not replace the existing name with a blank name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                   modifyContact = false;
                   return currentName;
              modifyContact = checkLengthValid(newModifiedName, "modified name");
              return newModifiedName;
         //Method to get the modified surname
         public String getNewModSurname(String currentSurname)
              String newModifiedSurname = JOptionPane.showInputDialog("Please enter the new surname for the contact or press cancel to keep it as is.");
              if(newModifiedSurname == null)
                   return currentSurname;
              modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
              if(modifyContact == false)
                   JOptionPane.showMessageDialog(null,"Surname not changed.","Information",JOptionPane.INFORMATION_MESSAGE);
                   return currentSurname;
              modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
              return newModifiedSurname;
         //Method to search and update the list with a succesfull search
         private void searchAndAddIfFound(String name, String surname)
              int count = 0;
              int numFound = 0;
              for(ContactDetails cd: phoneList)
                   cd = phoneList.get(count);
                   if(cd.name.equals(name.trim().toUpperCase()))
                        numFound ++;
                        searchList.add(cd);
                   count ++;
              if(numFound <= 0)
                   JOptionPane.showMessageDialog(null,"No contacts were found matching the dat you entered.","Information",JOptionPane.INFORMATION_MESSAGE);
              else
                   list.clear();
                   list.addAll(searchList);
         //Method that check all entries are a valid logical length
         //Method is based on assumption that a normal name, surname, and phone numbers are not longer than 10 characters long.
         //IF This method is changed please change the layout in the GUI as this is also set to fit with the layout that gives a neat //apperance
         private boolean checkLengthValid(String detailEntered, String whatWasEntered)
              boolean validLength = true;
              if(detailEntered.trim().length() >= MAX_LENGTH)
                   JOptionPane.showMessageDialog(null,"The " +whatWasEntered+" you entered is too long. Please try again and use a "+whatWasEntered+" that is less than "+MAX_LENGTH+" characters long.","Error",JOptionPane.ERROR_MESSAGE);
                   validLength = false;
              return validLength;
         private void finish()
              System.exit(0);
         //Method to update the list with a new entry
         private void updateListWithNew()
              try
                   ContactDetails cd = new ContactDetails();
                   cd.name = newName.trim().toUpperCase();
                   cd.surname = newSurname.trim().toUpperCase();
                   cd.home = newHome.trim();
                   cd.work = newWork.trim();
                   cd.cell = newCell.trim();
                   phoneList.add(cd);
                   JOptionPane.showMessageDialog(null,"Contact succesfully entered. To save this change press exit to save or use the save option in the toolbar menu.","Information",JOptionPane.INFORMATION_MESSAGE);
              catch(Exception e)
                   JOptionPane.showMessageDialog(null,"Failed to add contact to list. If problem persists please contact the software developer.","Error",JOptionPane.ERROR_MESSAGE);
              list.clear();
              list.addAll(phoneList);
         //Method to check for duplicate
         public boolean  checkIfDuplicate(String nameToCheck, String surnameToCheck)
              int count = 0;
              boolean valid = true;
              for(ContactDetails cd : phoneList)
                   cd = phoneList.get(count);
                   if(((nameToCheck.trim().toUpperCase()).equals(cd.name))&&((surnameToCheck.trim().toUpperCase()).equals(cd.surname)))
                        JOptionPane.showMessageDialog(null,"You may not enter a duplicate contact. Please try again and change the name and surname.","Error",JOptionPane.ERROR_MESSAGE);
                        valid = false;
                        break;
                   count ++;
              return valid;
         //Method to check that at least one phone number exists for contact
         public void checkAtLeastOneNumEntered()
              if((newHome.trim().length()<=0)&&(newWork.trim().length()<=0)&&(newCell.trim().length()<=0))
                   JOptionPane.showMessageDialog(null,"You have not entered any phone number at all. You must enter at least one phone number for a new contact.","Error",JOptionPane.ERROR_MESSAGE);
                   addToPhoneList = false;
         //Method that returns the list to the GUI
         public ArrayList<ContactDetails> getList()
              return list;
    }

    Should I start over from scratch? Can I get help with links to tutorials on following? How to create a java CRUD application (google not useful) and how to layer in java(google not useful)
    This is my pres layer as is is this wrong too?
         Filename:     ContactsListInterface.java
         Date:           16 March 2008
         Programmer:     Yucca Nel
         Purpose:     Provides a GUI for entering names and contact numbers into a telephone directory.
                        Also allows options for searching for a specific name and deleting of data from the record
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Phonebook1 extends JFrame implements ActionListener
    { //start of class
         // construct fields, buttons, labels,text boxes, ArrayLists etc
         JTextPane displayPane = new JTextPane();
         JLabel listOfContacts = new JLabel("List Of Contacts");               // creates a label for the scrollpane
         JButton createButton = new JButton("Create");
         JButton searchButton = new JButton("Search");
         JButton modifyButton = new JButton("Modify");
         JButton deleteButton = new JButton("Delete");
         Contact c = new Contact();
         ArrayList<ContactDetails> contactList = c.getList();
         // create an instance of the ContactsListInterface
         public Phonebook1()
         { // start of cli()
              super("Phonebook Interface");
         } // end of cli()
         public JMenuBar createMenuBar()
         { // start of the createMenuBar()
              // construct and populate a menu bar
              JMenuBar mnuBar = new JMenuBar();                              // creates a menu bar
              setJMenuBar(mnuBar);
              JMenu mnuFile = new JMenu("File",true);                         // creates a file menu in the menu bar which is visible
                   mnuFile.setMnemonic(KeyEvent.VK_F);
                   mnuFile.setDisplayedMnemonicIndex(0);
                   mnuFile.setToolTipText("File Options");
                   mnuBar.add(mnuFile);
              JMenuItem mnuFileExit = new JMenuItem("Save And Exit");     // creates an exit option in the file menu
                   mnuFileExit.setMnemonic(KeyEvent.VK_X);
                   mnuFileExit.setDisplayedMnemonicIndex(1);
                   mnuFileExit.setToolTipText("Close Application");
                   mnuFile.add(mnuFileExit);
                   mnuFileExit.setActionCommand("Exit");
                   mnuFileExit.addActionListener(this);
              JMenu mnuEdit = new JMenu("Edit",true);                         // creates a menu for editing options
                   mnuEdit.setMnemonic(KeyEvent.VK_E);
                   mnuEdit.setDisplayedMnemonicIndex(0);
                   mnuEdit.setToolTipText("Edit Options");
                   mnuBar.add(mnuEdit);
              JMenu mnuEditSort = new JMenu("Sort",true);                    // creates an option for sorting entries
                   mnuEditSort.setMnemonic(KeyEvent.VK_S);
                   mnuEditSort.setDisplayedMnemonicIndex(0);
                   mnuEdit.add(mnuEditSort);
              JMenuItem mnuEditSortByName = new JMenuItem("Sort By Name");          // to sort entries by name
                   mnuEditSortByName.setMnemonic(KeyEvent.VK_N);
                   mnuEditSortByName.setDisplayedMnemonicIndex(8);
                   mnuEditSortByName.setToolTipText("Sort entries by first name");
                   mnuEditSortByName.setActionCommand("Name");
                   mnuEditSortByName.addActionListener(this);
                   mnuEditSort.add(mnuEditSortByName);
              JMenuItem mnuEditSortBySurname = new JMenuItem("Sort By Surname");     // to sort entries by surname
                   mnuEditSortBySurname.setMnemonic(KeyEvent.VK_R);
                   mnuEditSortBySurname.setDisplayedMnemonicIndex(10);
                   mnuEditSortBySurname.setToolTipText("Sort entries by surname");
                   mnuEditSortBySurname.setActionCommand("Surname");
                   mnuEditSortBySurname.addActionListener(this);
                   mnuEditSort.add(mnuEditSortBySurname);
              JMenu mnuHelp = new JMenu("Help",true);                                        // creates a menu for help options
                   mnuHelp.setMnemonic(KeyEvent.VK_H);
                   mnuHelp.setDisplayedMnemonicIndex(0);
                   mnuHelp.setToolTipText("Help options");
                   mnuBar.add(mnuHelp);
              JMenuItem mnuHelpHelp = new JMenuItem("Help");                              // creates a help option for help topic
                   mnuHelpHelp.setMnemonic(KeyEvent.VK_P);
                   mnuHelpHelp.setDisplayedMnemonicIndex(3);
                   mnuHelpHelp.setToolTipText("Help Topic");
                   mnuHelpHelp.setActionCommand("Help");
                   mnuHelpHelp.addActionListener(this);
                   mnuHelp.add(mnuHelpHelp);
              JMenuItem mnuHelpAbout = new JMenuItem("About");                         // creates a about option for info about api
                   mnuHelpAbout.setMnemonic(KeyEvent.VK_T);
                   mnuHelpAbout.setDisplayedMnemonicIndex(4);
                   mnuHelpAbout.setToolTipText("About this program");
                   mnuHelpAbout.setActionCommand("About");
                   mnuHelpAbout.addActionListener(this);
                   mnuHelp.add(mnuHelpAbout);
              return mnuBar;
         } // end of the createMenuBar()
         // create the content pane
         public Container createContentPane()
         { // start of createContentPane()
              //construct and populate panels and content pane
              JPanel labelPanel = new JPanel(); // panel is only used to put the label for the textpane in
                   labelPanel.setLayout(new FlowLayout());
                   labelPanel.add(listOfContacts);
              JPanel displayPanel = new JPanel();// panel is used to display all the contacts and thier numbers
                   setTabsAndStyles(displayPane);
                   displayPane = addTextToTextPane();
                   displayPane.setEditable(false);
              JScrollPane scrollPane = new JScrollPane(displayPane);
                   scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // pane is scrollable vertically
                   scrollPane.setWheelScrollingEnabled(true);// pane is scrollable by use of the mouse wheel
                   scrollPane.setPreferredSize(new Dimension(400,320));
              displayPanel.add(scrollPane);
              JPanel workPanel = new JPanel();// panel is used to enter, edit and delete data
                   workPanel.setLayout(new FlowLayout());
                   workPanel.add(createButton);
                        createButton.setToolTipText("Create a new entry");
                        createButton.addActionListener(this);
                   workPanel.add(searchButton);
                        searchButton.setToolTipText("Search for an entry by name number or surname");
                        searchButton.addActionListener(this);
                   workPanel.add(modifyButton);
                        modifyButton.setToolTipText("Modify an existing entry");
                        modifyButton.addActionListener(this);
                   workPanel.add(deleteButton);
                        deleteButton.setToolTipText("Delete an existing entry");
                        deleteButton.addActionListener(this);
              labelPanel.setBackground(Color.red);
              displayPanel.setBackground(Color.red);
              workPanel.setBackground(Color.red);
              // create container and set attributes
              Container c = getContentPane();
                   c.setLayout(new BorderLayout(30,30));
                   c.add(labelPanel,BorderLayout.NORTH);
                   c.add(displayPanel,BorderLayout.CENTER);
                   c.add(workPanel,BorderLayout.SOUTH);
                   c.setBackground(Color.red);
              // add a listener for the window closing and save
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                             int answer = JOptionPane.showConfirmDialog(null,"Are you sure you would like to save all changes and exit?","File submission",JOptionPane.YES_NO_OPTION);
                             if(answer == JOptionPane.YES_OPTION)
                                  System.exit(0);
              return c;
         } // end of createContentPane()
         protected void setTabsAndStyles(JTextPane displayPane)
         { // Start of setTabsAndStyles()
              // set Font style
              Style fontStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
              Style regular = displayPane.addStyle("regular", fontStyle);
              StyleConstants.setFontFamily(fontStyle, "SansSerif");
              Style s = displayPane.addStyle("bold", regular);
              StyleConstants.setBold(s,true);
         } // End of setTabsAndStyles()
         public JTextPane addTextToTextPane()
         { // start of addTextToTextPane()
              int numberOfEntries = contactList.size();
              int count = 0;
              Document doc = displayPane.getDocument();
              try
              { // start of tryblock
                   // clear previous text
                   doc.remove(0,doc.getLength());
                   // insert titles of columns
                   doc.insertString(0,"NAME\tSURNAME\tHOME NO\tWORK NO\tCELL NO\n",displayPane.getStyle("bold"));
                   for(ContactDetails cd : contactList)
                        cd = contactList.get(count);
                        doc.insertString(doc.getLength(),cd.name+"\t"+cd.surname+"\t"+cd.home+"\t"+cd.work+"\t"+cd.cell+"\n",displayPane.getStyle("regular"));
                        count ++;
              } // end of try block
              catch(BadLocationException ble)
              { // start of ble exception handler
                   System.err.println("Could not insert text.");
              } // end of ble exception handler
              return displayPane;
         } // end of addTextToTextPane()
         // code to process user clicks
         public void actionPerformed(ActionEvent e)
         { // start of actionPerformed()
              String arg = e.getActionCommand();
              // user clicks create button
              if(arg.equals("Create"))
                   c.createNew();                                                  // method to create a new Contact
                   addTextToTextPane();
              if(arg.equals("Search"))
                   c.searchExisting();                                             // method to search for an existing entry
                   addTextToTextPane();
              if(arg.equals("Modify"))
                   c.modifyExisting();                                             // method to modify contact
                   addTextToTextPane();
              if(arg.equals("Delete"))
                   c.deleteExisting();
                   addTextToTextPane();
              if(arg.equals("Exit"))
         } // end of actionPerformed()
         // method to create a new contact
         public static void main(String[] args)
         { // start of main()
              // Set look and feel of interface
              try
              { // start of try block
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } // end of try block
              catch(Exception e)
              { // start of catch block
                   JOptionPane.showMessageDialog(null,"There was an error in setting the look and feel of this application","Error",JOptionPane.INFORMATION_MESSAGE);
              } // end  of catch block
              Phonebook1 pb = new Phonebook1();
              pb.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              pb.setJMenuBar(pb.createMenuBar());
              pb.setContentPane(pb.createContentPane());
              pb.setSize(520,500);
              pb.setVisible(true);
              pb.setResizable(false);
         } // end of main()
    } //end of class

  • "your system has not been modified error" will not let me install itunes on my computer an its for fraustrating need help!

    "your system has not been modified error" will not let me install itunes on my computer(windows 7 64 bit) and it is so faustrating i need help please and thanks!

    I had the same problem.I tried every solutions on the net but nothing worked.Luckily on that very day my free avast antivirus date expired(I dont currently have a paid antivirus) and I uninstalled it.Then I tried to install itunes and did it on the first go.But I am using a windows 7 32 bit so it might not work for you as you are on the 64 bit.Actually the antivrus was the culprit.Hope it helps.Thanks

  • What is this 205 error thing all i want to do is make cartoons is that so much to ask for i need help really bad ):

    all i want to do is make cartoons with photoshop and other programs but i cant is that to hard to ask for  ??? ): i need help very very badly

    Errors 201 & 205 & 206 & 207 or several U43 errors
    -http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • No support for pse4, need help with help and everything else.What's a layer? How can I get help PDF from CD? I don't have a clue how to use this. I have a Macbook pro.

    Need help with help pse4 not supported by adobe. how to do topics not available and I have never used any thing like this. Help says there is a download but have not been able to get it. What's a rookie to do ? Is there somewhere I can go to find out how to use PSE4?

    The internet is overflowing with tutorials on PSE. Just google what you want and include Photoshop Elements 4 as part of your search term, or  go to the library and they may have several different books on PSE 4. For PSE 4, you won't find a mac specific book, but that doesn't matter because the editor is the same on either program. Just substitute Command for Ctrl and Option for Alt in the keystrokes, and ignore anything about the organizer.
    Some popular sites for learning elements:
    http://www.photoshopelementsuser.com/
    lynda.com
    eclecticacademy.com
    youtube has a lot of video tutorials, too.

  • SAP query transport error - need help

    hello,
      The system is throwing the following error when importing the query from development to QA client.
    We already have the query imported the first time without errors. This is happening with subsequent transports if there is a change or any modification to the query.
    Below is the error log from SAP regarding the failed transport :
    R3TRAQQUFI was repaired in this system
    Message no. TW104
    Diagnosis
    Object R3TRAQQUFI is in repair status. Therefore, it cannot be imported.
    System Response
    The object is not imported.
    Procedure
    If you still want to import the object, release the relevant repair and repeat the import.
    Please help
    Thanks in advance.

    Hi
    Here I am sending the step by step procedure for the SAP Query. Hope this helps you, if so please issue points.
    1. Go to SQ02 .
    Select Environment -> Query Areas
    Select Standard Area (Client specific) as show below
    2. Select Environment -> Transports
    Select Import radio button
    Check Overwriting allowed (only with import/upload/copy)
    Remove Check for Test Run
    Select Transport InfoSets and queries radio button
    Fill Infoset and Query with corresponding names
    Fill Import option with transport request number.
    3.  Click on Execute button
    With this it will be done.
    Thanks for your patience

  • Query CDR database, need help finding table.

    Hi,
    I was asked to generate the following report:
    How many times for a certain amount of time both lines a certain extension has both lines simultaneously used.
    How many times for a certain amount of time a certain extension rings busy due to both lines being in use and another call comes in.
    Per Cisco documentation, I can probably find the field names. However, which tables would I need to query for the above requests? Cisco documentation shows a lot of tables, and it doesn't tell me which fields are in which table or visa versa.
    Thank you so much.

    I'd advise against doing too much raw SQL query work on CUCM - It's a call processing platform, not a reporting platform. Take the CDRs and feed them into your own database (or purchase a CallLogger which can do it automatically) and run queries from there.
    GTG

  • What components to get for computer need help!

    I have a hp envy 700pc model#700-214
    I'm trying to run Live video footage from my video camera INTO my computer and OUT my computer INTO my overhead projectors or tv monitors. We capture standard definition and high definition video footage. what video capture card and video card I need to get to make this possible? Need info! Need help! Please

    Hi,
    Please use pages #8 to #10 of the following manual:
        https://www.easyworship.com/downloads/EasyWorshipManual.pdf
    also:
       https://www.easyworship.com/support/kbarticle/98
    They all fit to your computer.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Apple macbook pro charger for MD314LLA, need help

    Guys,
    I both apple macbook pro last year( model MD314LL\A( 13.3 inch. My charger stop working and I am looking to purchase new one. While searching I am confused which one I have to buy. Need help from you community to please suggest me which one is best and compitable for my laptop.
    I see below 2 model in AMAZON. pls let me know which one is compitable for my laptop.
    http://www.amazon.com/MagSafe-Adapter-MacBook-Packaging-Warranty/dp/B00ATYFY7G/r ef=sr_1_1?s=electronics&ie=UTF8&qid=1375291474&sr=1-1&keywords=Apple+60W+MagSafe +Power+Adapter
    http://www.amazon.com/pay4save%C2%AE-Replacement-MagSafe-Connector-Warranty/dp/B 00ATZUI0I/ref=sr_1_4?s=electronics&ie=UTF8&qid=1375291474&sr=1-4&keywords=Apple+ 60W+MagSafe+Power+Adapter

    I personally would not purchase either charger.  I have seen many posts on this forum complaining about 'inexpensive' chargers and batteries for Apple MBPs.  To purchase these 'knockoff' counterfeits is tantamount to throwing your money away.  They may be 'refurbished' by a third party (something Apple does not do with chargers) but that would indicate that they failed before.  Or they may be cheap imitations built to questionable standards.
    You have spent a lot of money on your MBP, do not let it suffer a malfunction just to save $50.  You may find that repairs might cost a lot more than that.  Buy a real one from Apple as Ralph suggests.
    Ciao.

  • When i try to send  a message in mail it says it cannot use the server. I know very little about macs and need help

    i need help with the email on my mac. it says i cannot use the sever. any help would be awesome thank you

    If you are trying to connect to your ISP e-mail account. The ISP will help you setup and connect to your e-mail account. So, you might want to give them a call.
    Usually, when you are told that you can't use the server it means that there might be an error (either a wrong name/ address / password/ connection type/ etc.) so check your settings again...
    Else you could try the following:
    http://support.apple.com/kb/HT1277
    http://www.switchingtomac.com/tutorials/how-to-check-your-hotmail-using-mailapp/

  • DBMS_PARALLEL_EXEUCTE is not working for insert query.. Need help !!

    Hi All..
    I am trying to use the dbms_parallel_execute package to insert into my target table.
    But at the end of execution, the rows not getting inserted into the target table.
    Could any one please help on this?
    Below are the statements....
    create table target_table as select * from source_table where 1=0;
    --source_table has 100000 rows.
    BEGIN
      DBMS_PARALLEL_EXECUTE.create_task (task_name => 'test1');
    END;
    BEGIN
      DBMS_PARALLEL_EXECUTE.create_chunks_by_rowid(task_name   => 'test1',
                                                   table_owner => 'SYSTEMS',
                                                   table_name  => 'TARGET_TABLE',
                                                   by_row      => TRUE,
                                                   chunk_size  => 10000);
    END;
    DECLARE
      l_sql_stmt VARCHAR2(32767);
    BEGIN
      l_sql_stmt := 'insert into PRD_TAB
         select * from dbmntr_prd_tab';
      DBMS_PARALLEL_EXECUTE.run_task(task_name      => 'test1',
                                     sql_stmt       => l_sql_stmt,
                                     language_flag  => DBMS_SQL.NATIVE,
                                     parallel_level => 10);
    END;
    After executing the above statement, I can find the targt_table has zero rows.. Could anyone please correct me If I am wrong with any of above statements?

    Could anyone please correct me If I am wrong with any of above statements?
    As Hoek said you haven't created the SQL statement properly. See the 'RUN_TASK Procedure section of the  DBMS_PARALLEL_EXECUTE chapter of the doc
    http://docs.oracle.com/cd/E11882_01/appdev.112/e16760/d_parallel_ex.htm#CHDIBHHB
    sql_stmt
    SQL statement; must have :start_id and :end_id placeholder
    That doc has an example in it.

  • Buying new PC for Adobe, need help

    Hi everyone!
    First thing, I apologise for my English, I hope you can understand my writing.
    One of my best friends is photographer and graphic designer and she asked me for help buying a new PC because the old one broke (it was a laptop). She needs a desktop PC able to run Premiere Pro, After Effects, Photoshop, Cinema 4D, Maya and V-Ray. She is not an expert and she is still learning these technologies so I think she is not going to get the best out of these programs.
    I´m IT technician so I know a little about hardware, but I don´t work with this kind of software, and I find their system requirements specifications too simple. Her budget is 1000$ (she also needs a monitor). I know this budget is limited for this kind of work and software, so I was thinking about an AMD PC, pretty powerful but much cheaper than an intel core i7 + nVIDIA GTX 770 + SSD solution (it was the first I thought but it´s definitely out of her budget). I would suggest her a PC with these specs:
    CPU: AMD FX-8320 or FX-8350
    GPU: AMD Radeon R9 280
    RAM: G.Skill Ripjaws X DDR3 2133 CL11 8GB (2x4GB) or DDR3 1600 8GB (2x4GB) -> 2 modules to take advantage of Dual-Channel.
    HDD: Seagate Barracuda 7200.14 1TB SATA3
    PSU: Tacens Radix VII AG 700W 80 Plus Silver
    Monitor: Dell UltraSharp U2414H 24" LED IPS
    Considering the system requirements of the programs, I think there is going to be no problem with the CPU because the PC is going to run under Windows 7 SP1 64bits or Windows 8.1 64 bits and she is not going to run MAC and it´s SSE, SSE2, SSE3 and SSE4 capable, but I´m not sure about the GPU....
    Is this PC incompatible with these programs or any of their functions?
    Thank you for your attention. I look forward to your response.
    Regards!

    Here are the issues:
    1) The AMD CPUs that you listed are actually slower in Premiere Pro than even an Intel i5 CPU that lacks hyperthreading, let alone an i7 CPU.
    2) Despite improvements in OpenCL support, Premiere's performance in OpenCL is still nearly two times slower than NVidia's CUDA with MPE's GPU-intensive modes. Because of that, the R9 280 is slower than a GeForce GTX 750 Ti – and may be as slow as a plain GTX 750 – in Premiere's MPEG GPU-accelerated mode. (In Windows versions of Premiere Pro CC or later, OpenCL is unavailable with an NVidia GPU installed, making CUDA the only GPU-accelerated mode available with an MVidia GPU.)
    3) Your proposed build has only a single disk for absolutely everything – OS, programs, media cache, previews, media, projects and exports, all on the exact same single disk! That severely degraded performance due in large part to the single disk continually performing housekeeping tasks in addition to a gazillion other tasks. In fact, that single disk used in this way may very well be effectively six times slower than that disk is capable of performing – and disk performance these days is the biggest bottleneck in today's systems. Even the very fastest disks are the slowest part of a PC, and slowing that down by a factor of six is just plain foolish.

Maybe you are looking for

  • 4) Numerial input for a group of data

    LookoutDirect 4.5 4) I have a table of hundreds of data, and all of them need a input. How can I make only one numeral input for all of them? That means I click any data in the table I can get to the same numeral input popup window and enter a number

  • Item Category Completion rule and Copy Control for contract reference

    Hi We are creating sales document wrt contract. The item category completion rule for item category WVN is C i.e. item is completed after target quantity is fully referenced. We dont want to change this but we want that even if the target quantity is

  • Collect response PDF forms and use responses in XLS

    Hello, If I have a PDF forms, and I collect forms complete, can I transform received replies in excel format, without publish data's in internet? Thanks

  • Can we Copy a Webdynpro Component. If so, How??

    I frequently get a situation where I want to keep a copy of the web dynpro component developed and make changes such that they do no update the copy. I have tried making a copy of it in the same project. BUt this gets updated when we deploy the compo

  • Adding Covers and song info slow down

    I just my new 120gb Ipod for christmas and I started to load album covers to it. It started out fine, the album cover would load/save in no time, but now it takes forever to save a cover to a song, any help on why?