NEED HELP!! creating a method to search records from a data.dat file

i am having a lot of trouble trying to create a method for searching records from a data.dat file as a contacts application i am using (for) and (if) together and getting the same error messages saying a ")" is needed when it doesn't and illegal start of expression can anyone help! on letting me know how you create search methods! thanks

public static void search_records()
          System.out.println("Please Enter a Surname (* for all):");
          user_surname = data_input.next();
          System.out.println("Please Enter a firstname (* for all):");
          user_firstname = data_input.next();
          for (int i = 0; i < number_of_records; i++)
               if(user_surname.compareTo(lastName) || user_surname.compareTo(*));
                         if(user_firstname.compareTo(firstName[i]) || user_firstname.compareTo(*));
                              system.out.print("Result:",number_of_records);

Similar Messages

  • What is the Method to get record from DB as Date fornat??

    Halo, i want to know what is the method to get the data from database which is store it in date format.
    Previously, i am using the getDate() to get the data together with the while (rs.next() ) method after using the "select" statement to get the data from data base.
    Here is the example when i retrieve record from database:
    java.util.Date date1 = new java.util.Date();
    String getRecord = "SELECT * FROM employee "
    ResultSet rs = db. execSQL(getRecord);
    while(rs.next() ){
    String name = rs.getString("name");
    date1 = rs.getDate("date");
    }notes: method getDate() had deprecated since JDK version 1.1.
    So, i need to know what is the method to get the date record??
    Thank you.....

    Halo, ...Yeah, Halo! Love that game...
    Um, use getDate(). ResultSet.getDate() is not deprecated. If you think so, then you better go reread the API docs, cuz you're reading the wrong ones.

  • I need help creating a method!

    Hi,
    I'm following a Java course, we have a homework to do and I have some problems with it... We have to create a table (int [] a) with a 100 elements ( 0,2,4,6 ... to 198 - all even) we have to go through a "for" to fill the table (I have no problem with that) but the thing is that we have to create a JOptionPane asking a value and our method has to find that value in the table and give the position of that value. And if the value is not even a JOptionPane has to respond "that value is not in the table". I'll give yall an example:
    let's say that table [4] contains the value 8. If "8" is enter in the JOptionPane the program will return "the position of 8 in the table is 4"
    here is what I have done so far (some of the text is in french):
    import javax.swing.*;
    import java.awt.*;
    public class TP3a extends JApplet{
         JTextArea zone = new JTextArea ();
         String sortie= " ";
         String cle1;
         int indice=0;
         int cle;
         int [] tableau = new int [100];
              public void init (){
                        for (int x=0; x<=200; x++){
                             tableau[x]= x*2+2;
                             indice=x;
                   cle1=JOptionPane.showInputDialog ("Entrer la valeur de l'element que vous desirez voir: ");
                   cle=Integer.parseInt (cle1);
                   rechercheIndice (int tableau [], cle);
                        sortie+=tableau [cle];
                        zone.append (sortie);
                        JOptionPane.showMessageDialog (null, zone, "Tableau", JOptionPane.PLAIN_MESSAGE);
                        System.exit (0);
              public int rechercheIndice (int tableau [], int cle){
                   for (int x; x<=tableau.length; x++){
                        if (cle == tableau [x])
                             return tableau [cle];
                             else
                             continue;
    Please help me!!!
    Thanks,
    Neriade

    import javax.swing.*;
    import java.awt.*;
    public class TP3a extends JApplet{
          JTextArea zone = new JTextArea ();
          String sortie= " ";
          String cle1;
          int indice=0;
          int cle;
          int [] tableau = new int [100];
          public void init (){
          for (int x=0, y = 0; x<100; x++, y += 2 ){
             tableau[x]= y;
             indice=x;
          cle1=JOptionPane.showInputDialog ("Entrer la valeur de l'element que vous desirez voir: ");
          cle=Integer.parseInt (cle1);
          int i = rechercheIndice (tableau, cle);
          System.out.println( "i: " + i );
          sortie+=tableau [cle];
          zone.append (sortie);
          JOptionPane.showMessageDialog (null, zone, "Tableau", JOptionPane.PLAIN_MESSAGE);
          System.exit (0);
          public int rechercheIndice (int[] tableau, int cle){
          for (int x = 0; x<tableau.length; x++){
             if (cle == tableau [x])
                return x;//tableau [cle];
          return -1;
    }

  • Need help with Sound Methods

    Hi, I am new to java and need help with sound methods.
    q: create a new method that will halve the volume of the positive values and double the volume of the negative values.
    Message was edited by:
    Apaula30

    duplicate message #2

  • Need help / Advice ; manage daily millions of records;;plz help me:)

    Hi all,
    I've only 2 years of experience in Oracle DBA. I need advice from Experts:)
    To begin, the company I work for, decide to daily save in our Oracle database about 40 millions of records in our only table (User tables). These records should be daily imported from csv or xml feeds into one table.
    This 's a project that need :
    - Study the performance
    - Study What is required in terms of hardware
    As a leader in the market, Oracle 's the only DBMS that could support this size of data, but what's the limit of Oracle in this case? can Oracle support and manage perfectly daily 40 millions of records and for many years, ie We need all data of this table, we can't consider after a period that we don't need history: we need to save all data and without purge the history and this for many years i suppose!!! you can imagine 40 daily millions of records and for many years!!!
    Then we need to consolidate from this table different views (or maybe materalized view) for each department and business inside the company, one other project that need study!
    My questions 're :Using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0:
    1-Can Oracle support and perfectly manage daily 40 millions of records and for many years?
    2-Study the performance ; which solutions, technics could I use to improve the performance of :
    - Daily Loading 40 millions of records from csv or xml file/files?
    - Daily Consolidate / managing different views/ materalized view from this big table?
    3- What is required in terms of hardware? features / Technologies( maybe clusters...)
    Hope that experts help me and advice me! thank you very much for your atention :)

    1-Can Oracle support and perfectly manage daily 40 millions of records and for many years?Yes
    2-Study the performance ; which solutions, technics could I use to improve >>>the performance of :Send me your email, and I can send you a Performance tuning metodology pdf.
    You can see my email on my profile.
    Daily Loading 40 millions of records from csv or xml file/files?DIrect Load
    - Daily Consolidate / managing different views/ materalized view from this big table?You can use table partitions, one partition for each day.
    Regards,
    Francisco Munoz Alvarez

  • Uber Noob Needs Help Creating website!

    I need help creating my webpage: It has a textbox on it were
    the user enters a URL and it then redirects the end user to that
    URL when they press the GO Button. It also has a check box saying
    "Hide my IP", If the end user clicks this box and then clicks go
    they will be directed to the website they stateted in the Textbox
    but this time it shall mask there IP Address so they can bypass
    proxys and surf anonomosly. Please can someone give me some HTML
    code i could use for this site or a Link to a website that can give
    me the code.

    I assume the application is connecting to Oracle using an application ID/password. If so, check to see if that user has a private synonyn to the table. If so drop it since you have a public synonym.
    Verify that the public synonym is in fact correct. Drop and recreate the public synonym if you cannot select against the synonym name using an ID that can perform select * from inhouse.icltm where rownum = 1. That is if this other user cannot issue select * from icltm where rownum = 1 without an error.
    Check that the application ID has the necessary object privileges on the table.
    Queries you need
    select * from dba_synonyms
    where table_owner = 'INHOUSE'
    and table_name = 'ICLTM'
    You may find both public and private synonms. Either fix or delete. (Some may reference someelses.icltm table if one exists)
    select * from dba_tab_privs
    where table_name = 'ICLTM'
    and owner = 'INHOUSE'
    Note - it is possible to create mixed case or lower case object names in Oracle by using double quotes around the name. Do not do this, but do look to see that this was not done.
    You could also query dba_objects for all object types that have the object_name = 'ICLTM'
    HTH -- Mark D Powell --

  • I need help importing navigation bars and rollover buttons from fireworks?

    I need help importing navigation bars and rollover buttons from fireworks, drop down menus and rollover states won't work!
    Thanks

    In my experience, the code created by graphics apps is less than satisfactory. And image based menus are very awkward for several reasons. 
    #1 If you decide to change your menu later, you must go back to your graphics app and re-craft the whole thing.  After 2-3 times of this, it gets old in a hurry.
    #2 Image based menus cannot be "seen" by search engines, screen readers and language translators.
    #3 CSS styled text menus are better for your site's visibility, accessibility and they are a snap to edit in Dreamweaver.
    That said, if you're still married to image based menus, use Fireworks to create images only. Use Dreamweaver's Image Rollover Behaviors to create your rollover scripts.
    Nancy O.

  • Hi I need help ..I do not know how to edit a pdf file that I scanned in,

    Hi I need help ..I do not know how to edit a pdf file that I scanned in, will someone please tell me what I should do PLEASE HELP

    What program are you using?  If it is just Adobe Reader you can not edit.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    The Mac OS X and iOS versions are separate products

  • I need help! I cannot access my iTunes from my window's. I keep getting message "error 7" and also MSVCR80.dll missing. I do not know how to access this?

    I need help! I cannot access my iTunes from my window's. I keep getting message "error 7" and also MSVCR80.dll missing. I do not know how to access this?
    I tried downloading the latest version of iTunes, but it does not sync to my windos 7 HP because of the previous messages. Any feedback would be greatly appreciated.
    Thank you,
    ElsaV73

    Hope this article helps you:
    http://support.apple.com/kb/TS5376
    Pleas reply with any further questions.

  • Need assistance searching records from multiple tables - Please Help!

    Hi, I've been trying to solve this problem for several weeks now, and I have exhausted all of my knowledge and experience.  I need help, and I hope someone here can give me some direction.
    I am using VB 2008, and the CR that comes bundled with VS 2008 Pro.  My database is a SQL Server 2005 CE v3.5 (a *.sdf file).  I am connecting to the database through a dataset, and I am displaying the report in a CrystalReportViewer.
    My dataset consistes of two tables:
    1) tblCustomers which has a primary key "CustID", and contains only customer contact and personal information. 
    2) tblDateVisited which has a primary key of "VisitID", but it also has a column titled "CustID". Basically, every time a customer visits the business, details of that visit are recorded in tblDateVisited, and that record is associated with the customer by their CustID.
    Here's what I'm trying to accomplish:  I want to be able to display only Customer records when the customer has visited and that visit matches certain criteria.  Right now, I am trying to match visits from the "tblVisitDate.PlayerType" column.  If the customer has ever had a visit where they matched a particular player type, I want to see those customer records.
    I don't know what I'm doing wrong, though.  I can search a dataset if I am only querying one table and pulling records from that table.  However, whenever I try to add a second table and perform queries on that table to get records from the first table, I can't return any records. 
    If it helps, I am trying to use one CrystalReportViewer to display multiple reports (user choice) and here's how I'm loading the report into the viewer:
    Me.tblCustomersTableAdapter.Fill(Me.dsPlayerTypeReports.tblCustomers)
    Me.tblDateVisitedTableAdapter.Fill(Me.dsPlayerTypeReports.tblDateVisited)
    Me.ReportFile.SetDataSource(dsPlayerTypeReports.Tables(1))
    I am suspicious that my problem is in the Tables(1) method.  It confuses me that I can only assign one table as a datasource when I obviously need access to two tables to make this selection work. 
    Whatever the case, I'm at the end of my rope with this one.  I'm not prone to giving up, but I'm at a dead end currently. 
    Any attempt to assist me with this will be greatly appreciated, successful or not.
    Thanks in advance!
    -Will

    No, I am connected via ADO.NET.  I don't think SQL CE can connect through ODBC (or if it can, I haven't been able to figure out how, yet).  So this isn't a stored procedure.
    When I examine the link, I can only choose an Inner Join or a Left Outer Join.  Right Outer and Full Outer are not available.  Could this be a problem with the dataset I'm using?
    Could you explain what you mean by display all of the records and then choose the selection criteria?

  • Need help to develop a customised search  BSP page

    Hi Every one.
    I need to develop a custom BSP search page which is a modified version of search.htm page of HCM_LEARNING bsp application.
    here we need to replace the Qualification dropdown boxes with 2 qualifications in tree format where first one is 1. Prerequisite and 2. Aspired . the values will be in node format and the other functionality should work the same  way as it works in search.htm page.
    How to handle 3 events now?? 1. Node click on Prerequisite Tree
                                                 2. Node Click on Aspired Tree
                                                 3. Find button click
    Only when the find button is clicked , The search should happen not on any node click.
    Could you please suggest me some thing how to proceed??
    Samikhya

    Look at the below step by step blogs to create custom serach page. It will help.
    /people/koen.labie2/blog/2006/11/17/showhelp-functionality-with-pop-up--part2
    /people/koen.labie2/blog/2006/09/28/showhelp-functionality-with-pop-up
    /people/thomas.jung3/blog/2004/11/01/bsp-value-input-help-popups-version-20-part-1
    /people/thomas.jung3/blog/2004/11/01/bsp-value-input-help-popups-version-20-part-2
    /people/thomas.jung3/blog/2004/09/17/bsp-150-a-developer146s-journal-part-xii-150-value-input-help-popups
    Regards,
    Raja

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code&#93; at the top of your block of code and the tag &#91;/code&#93; at the bottom, like so:
    &#91;code&#93;
      // your code block goes here.
    &#91;/code&#93;

  • Need to create Customer to multiple sites record in one run.

    Hi all,
    we have one table called (e.g.) Prospect. To this table we can associate three different sites: one the legal
    site, one admin and one for logistic. All the three sites refer to the main Prospect table via the Prospect_id
    and related info are all saved into the same Site_all table (the site type is not stored directly into the site_all
    table but via a use_site_all table, similarly to what happens with some standard OApps tables).
    We need to create the Prospect and associated three sites via an OA Framework page (actually multiple steps).
    So to visually resume:
    _ Site1 ---- use:legal
    Prospect - Site2 -- use:admin
    - Site3 --- use:logistic
    What's the best approach to achieve the creation of the records in the tables ?
    a) to add three EO for the Site table (with related AO) and one big ProspectAllVO view object containing all the fields
    from the three EO ?
    b) to add just one EO for the site and reference it three times while defiing the ProspectAllVO ?
    c) to specify a View Link (but this should be done three times and I'm not sure how to synchronize and manage
    the transaction for the creation ?
    d) AOB ?
    Thanks in advance. Regards.
    Giuseppe Naldi

    is it really just one IDOC?
    I have never seen that SAP just does a part of one IDOC.
    the structure of DEBMAS ist like this:
    E1KNA1M
    --E1KNVVM
    E1KNVPM
    E1KNVDM
    E1KNVIM
    --E1KNB1M
    which means for your example it should be like this
    E1KNA1M
    --E1KNVVM
    E1KNVPM
    E1KNVDM
    E1KNVIM
    --E1KNVVM
    E1KNVPM
    E1KNVDM
    E1KNVIM
    --E1KNB1M
    and in this case I am very certain that it would never just process and create the part for one sales area.
    Maybe your customer already exists from ealier tests with just one sales area.
    Display your IDOC in WE02 or WE05 and make sure you have a value in name1 field

  • Need help on case statements to validate records

    Hi Experts ,
    My table :
    seq_num
    col2
    col3
    col4
    1
    A
    12345
    P
    2
    B
    1
    123%23
    3
    C
    1
    23AB
    4
    D
    1
    20131001
    5
    E
    1
    6
    A
    13245
    Q
    7
    B
    1
    12345
    8
    C
    2
    1234*AB
    9
    D
    5
    20140112
    10
    E
    1
    00020
    my output
    seq_num
    col2
    col3
    col4
    Status
    Reason
    1
    A
    12345
    P
    Valid
    2
    B
    1
    123%23
    invalid
    Special Character for col4
    3
    C
    1
    23AB
    Valid
    4
    D
    1
    20131001
    Valid
    5
    E
    1
    invalid
    null for col4
    6
    A
    13245
    Q
    invalid
    Invalid character col4 || invalid number for col3
    7
    B
    1
    12345
    Valid
    8
    C
    2
    1234*AB
    Invalid
    Special Character col4 ||invalid col3
    9
    D
    5
    20140112
    invalid
    Future dates col4 ||invalid col3
    10
    E
    1
    00020
    Valid
    Sql :
    with t as
    ( select 1 as seq_num,'A' as col2 ,12345 as col3 ,'P' as col4 from dual
    union all
    select 2 ,'B',1,'123%23' from dual
    union all
    select 3,'C',1,'23AB' from dual
    union all
    select 4,'D',1,'21-02-2013' from dual
    union all
    select 5,'E',1,null from dual
    union all
    select 6,'A,13245,'Q' from dual
    union all
    select 7,'B',1,12345 from dual
    union all
    select 8,'C',2,'1234*AB' from dual
    union all
    select 9,'D',5,'25-01-2014' from dual
    union all
    select 10,'E',1,20 from dual
    I am applying rules on col3 and col4 for each records row-wise.
    I need case statements to populate status and reason columns after applying below rules
    Rules
    Col3 :
    For A record ,it should be 12345 always .
    For B,C,D,E , record should be always 1
    col4
    For A record , it should be either P or R
    No null values for all A, B,C,D,E records
    for B record , it dont contain special charecters
    for C RECORD ,  it dont contain special charecters
    for D record ,it should not contain future dates (dates are in yyyymmdd format and  less than  sysdates are valid )
    I have other columns as well ,as i not included here
    .It would be great if you Could  help on case statements
    Thanks and Regards,
    Sumanth

    I've adjusted Gregs nice example a bit. This should work:
    with w_base as (
          select seq_num, col2, col3, col4,
                 case when (col2 = 'A'                 AND col3 = 12345 )
                        OR (col2 in ('B','C','D','E')  AND col3 = 1)
                            then '' else '||invalid col3' end ||
                 case when (col2 = 'A'        AND col4 not IN ( 'P', 'R' ) )
                            then '||invalid col4' else '' end ||
                 case when (col2 IN ( 'B', 'C' )   AND col4 != translate(col4, 'a!@#$%^*()','a') )
                            then '||special character for col4' else '' end ||
                 case when (col2 = 'D'        AND col4 >= to_char(sysdate,'yyyymmdd') )
                            then '||future dates col4' else '' end
                   reason
          from ( select 1 as seq_num, 'A' as col2, 12345 as col3, 'P' as col4  from dual union all
                 select 2,            'B',         1,             '123%23'     from dual union all
                 select 3,            'C',         1,             '23AB'       from dual union all
                 select 4,            'D',         1,             '20130212'   from dual union all
                 select 5,            'E',         1,             null         from dual union all
                 select 6,            'A',         13245,         'Q'          from dual union all
                 select 7,            'B',         1,             '12345'      from dual union all
                 select 8,            'C',         2,             '1234*AB'    from dual union all
                 select 9,            'D',         5,             '20140125'   from dual union all
                 select 10,           'E',         1,             '20'         from dual )
    Select seq_num, col2, col3, col4,
           case when reason is null then 'Valid' else 'Invalid' end status,
           substr(reason, 3 ) reason
    from w_base
    It returns
    SEQ_NUM
    COL2
    COL3
    COL4
    STATUS
    REASON
    1
    A
    12345
    P
    Valid
    2
    B
    1
    123%23
    Invalid
    special character for col4
    3
    C
    1
    23AB
    Valid
    4
    D
    1
    20130212
    Valid
    5
    E
    1
    Valid
    6
    A
    13245
    Q
    Invalid
    invalid col3||invalid col4
    7
    B
    1
    12345
    Valid
    8
    C
    2
    1234*AB
    Invalid
    invalid col3||special character for col4
    9
    D
    5
    20140125
    Invalid
    invalid col3||future dates col4
    10
    E
    1
    20
    Valid
    edited some bugs :) now it should be fine! really

Maybe you are looking for

  • I changed my email address now the pop up has stored my old email address and won't let me log in

    How do I change mly email address when the log in pop up has my old email address stored and won't let me change it?  I already changed it on my account, but the old address is locked in.

  • Profit centre in fbl1n & fbl5n

    Hi, In case of vendor or customer line item display, the profit centre is not showing. We have implemented GL Profit Centre concept rather than Business area concept. But now the question is when the client is asking any report on area wise vendor or

  • Links blocked in acrobat reader

    I have a document with multiple links to various external internet sites, where all the links work fine on a mac. But one link, doesn't work on a pc and the pc user is saying the only way he managed to get access was to adjust his trust settings with

  • Proxy to Webservice

    Hi All, I have to configure the scenario to send the data from r/3 to webservice . Receiver side we need to send a JMS message. How can we send the JMS messages to webserver as we have to use SOAP/HTTP adapter to communicate with webservices.  Any on

  • Email facility in Oracle 9i?

    Is there an email facility in Oracle 9i.. If so, how can this be done.. very new to this package Thanks Shameen