How to searc a different field in a database depending on user input

I havea page with witha search form that has a search from and a number of
radio buttons to choose from. The radio buttons have the same name as
particular fields in my database. Ther serach form is shown here.
<form name="searchForm" id="searchForm" method="post" action="search_participants">
      <div>
        <input name="search" type="radio" value="Participant_Name" />
    Participant ID </div>
      <div>
        <input name="search" type="radio" value="First_Name" />
    First name </div>
      <div>
        <input name="search" type="radio" value="Last_Name" />
    Last name </div>
      <div>
        <input name="search" type="radio" value="Details" />
    Details</div>
      <div>
        <input name="search" type="radio" value="Email" />
    E-Mail</div>
      <p class="menu">
        <input name="searchField" type="text" id="searchField" size="20" />
        <input name="Submit" type="submit" id="Submit3" value="Search" />
      </p>
    </form>
PreparedStatement StatementparticipantRecordset = ConnparticipantRecordset.prepareStatement("SELECT User_ID, Participant_ID, Password, First_Name, Last_Name, Details, Email FROM Administration.participant WHERE Participant_ID = '" + searchString + "' ");This code works fine at the mo but how do i replace the particicpant_ID part
with my dynamic searchFor String that I have. I have allreadt tried a few times
but i could not get it to work. Could someone please give me the correct
syntax to do this.
Thanks

Crossposted: http://forum.java.sun.com/thread.jspa?threadID=633849&messageID=3677215#3677215

Similar Messages

  • How to find the structure fields data in database tables?

    how to find the structure fields data in database tables?

    Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related.  There are several other more general ABAP related forums.

  • Display different portal page or portlet depend on user's

    can I display different portal page or portlet depend on user's
    profile,such as: if user's gender is male, display a portal
    page named "malePortal",if the user's gender is female, display
    a portal page named "femalePortal"

    This can be accomplished by using Entitlements Segments.
    You can define them in EBCC. you will have to define a user profile which
    will contain user information (like gender).
    Once you have two segments defined, you can use portal administration site
    to configure entitlements for pages and portlets.
    Regards
    Mike
    "Joshua Davies" <[email protected]> wrote in message
    news:3d1c78cb$[email protected]..
    >
    "xxxx" <[email protected]> wrote:
    can I display different portal page or portlet depend on user's
    profile,such as: if user's gender is male, display a portal
    page named "malePortal",if the user's gender is female, display
    a portal page named "femalePortal"If it has to be a portlet, you'll have to create a custom web flow thatstarts with
    a custom IP class. If you just want to show different content based on auser profile
    value, take a look at "Content Selectors" in EBCC; this sounds like aneasier way
    to get where you're trying to go.
    I don't think there's a way to display different portal pages/portalsbased on user's
    profile settings.

  • How would I change the variables in multiple methods with the user input?

    Here is my code for a tic tac toe game I have to do for an assignment, it is currently set at the normal 3 x 3, but the teacher what the user to be albe to change these to between 3-5 before they start playing, here is my codeing
    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[i][j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[i][j].equals(" "))
    board[i][j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[i][j];
    r = r + "|\n";
    return r;
    I am having a problem figuring out how to change the variables ROWS , COLUMNS to the given user input, it seems easy but i can't really figure out how to do it
    thanks ahead of time

    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[j].equals(" "))
    board[j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[j];
    r = r + "|\n";
    return r;
    }sorry for not posting code correctyl new to this forums
    Thanks for the help but let me rephrase my question, the rows and columns are the same like 3x3, 4x4 ,or 5x5,
    -when the program runs it will ask the user for what they want to set the tic tac toe at between 3 - 5.
    My question is how do I get the code
    Scanner a = new Scanner ( System.in );
    System.out.print("Enter the size of the tic tac toe box to be between 3-5 : ");
    int sizeTicTacToe = a.next();to change the variables of ROWS COLUMNS
    I just want to know of a way to make the users input of sizeTicTacToe to change the variables ROWS & COLUMNS in my toString() and TicTacToe() methods

  • How to create a new field in predefined database table

    Hi friends,
    now i am working on scripts. In script form i have got a new field(vehicle number in goods receipt against purchase order) which is not available in any table.  i think we have to create a new field in database table.how to create  field in a pre defined data base table.

    Hi,
    To add new field to table, there are two option.
    1.Include structure and
    2. append struct..
    the best way is append structure.
    goto se11>give your table name>there is append structure button, when you will click on it, it will create a 'append  structure',
    after activating it, it will add fields to your table.

  • How fill r/3 transaction field with current property value of user profile?

    Hi Experts!! I
    have a transaction iview ("sap_transaction_iview") currently pointing to a R/3 transaction. I want to use the "application parameters" iview field to pass a variable value to the R/3 transaction. We need to pass R/3 userID that we store in property department of portal user profile. Thus, we need to pass dinamically a value as part of name/value pair in application parameter.
    How can do achive that?
    Thanks in advance to all for your advices and help.
    Best Regards,
    Rosa Ferrando

    Hi,
      I think this blog should help you do it. Create a java class or portal project. You can create iView from par then.
    How to launch SAP transaction & pass parameters via URL
    Here in the same component, you can try getting the user profile attribute and pass it on to this url.
    Here is another link about the same topic.
    Passing a parameter to a transaction iview
    Regards,
    Harini S

  • How to populate 2 screen-fields with one [ON VALUE-REQUEST FOR input] evnt?

    I have a selection screen with 2 text inputs - input1, input2.
    For the first one I have an "AT SELECTION-SCREEN ON VALUE-REQUEST FOR input1" event.
    I successfully get a value there and that is set to the screen field. But I also want input2 to be automatically populated with a value corresponding to the selected input1 (eg. input1=ID, input2=Name).
    I'm able to set input2 ABAP variable but not the screen-element.
    (I guess that ON VALUE-REQUEST doesn't fire any events for screen fields update, because if I press ENTER after using my search-help, then input2 is set with the right value)
    How to solve the problem?

    Hi Ramchander,
    Actually I used FM F4IF_FIELD_VALUE_REQUEST which doesn't have mapping parameters.
    But after your advice I looked through F4IF_INT_TABLE_VALUES_REQUEST and found that it's
    DYNP_VALUES_UPDATE FM that solves my task.
    Thanks!

  • How do you direct someone to a specific page depending on form input?

    I have a web form and would like to send the user to a specific page depending on what radio button they check.
    For example if they say they like vanilla ice cream (variable = "vanilla") in the form, send them to page "A" once they hit the submit button. If they like chocolate (variable = "chocolate") , send them to page "B" once they hit submit.
    Thanks, I really appreciate your help.
    Ivan

    Although this is not really a java related issue, here is some code that should work for you:
    <HTML>
    <BODY>
    <SCRIPT language="JavaScript">
    function checkIce(form)
         if (form.elements["ice"][0].checked) form.action = "http://www.sun.com";
         else if (form.elements["ice"][1].checked) form.action = "http://www.microsoft.com";
         else
              alert ("You'll have to select a flavour!");
              return false;
         return true;
    </SCRIPT>
    <FORM method="post" onsubmit="checkIce(this)">
    <INPUT type="radio" name="ice" id="vanilla">Vanilla Ice Cream
    <BR>
    <INPUT type="radio" name="ice" id="chocolate">Chocolate Ice Cream
    <HR>
    <INPUT type="submit">
    </FORM>
    </BODY>
    </HTML>

  • How to find the Databse field used in which Transaction

    Hi,
    I have one query about:
    How to find the particular field from the Database table, used in which transaction?
    Bottomline:  I want to find the LIKP- LIFEX field, used in which Transaction. I know it is related to inbound delivery, but i couldn't find it in which transaction it is.
    Thanks in advance.
    Jai.

    Hi Jai,
    The field is called External ID which equal to LIKP-LIFEX or RV50A-VERUR_LA (structure).
    Path:
    Goto -> Header -> Administration -> External ID.
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • How to make a form verify from a database

    I need to create a page that will have a person enter their
    membership number and if they are in our database they will receive
    a 10% discount on their items ordered.
    I set up a database and my webpage with a textfield for them
    to enter their member number. But now sure how or what needs to be
    done to the webpage to connect to the database and return a true
    statement so the person gets a discount if they are a member.
    Also, is there a script that would calculate a 10% discount?

    Ajax (Javascript) would have an edge over PHP in regards to responsiveness. The best solution might combine all three methods (PHP, Javascript, HTML).
    Are the responses going to be stored in a database? If so then you can also use the database to store the questions, complete with form fields.
    One big difference between javascript and PHP is that PHP does nothing until you either open a new page or hit submit, and then it runs in a linear fashion until it reaches the end of the script. Javascript, on the other hand, can respond to other "events" that take place, such as when the user clicks away from a form field. With the advent of html5, HTML now has a little of the responsiveness of javascript.
    PHP is the tool you use for processing form data and interacting with the database, if each form response is followed by a complete PHP processing cycle, the form will seem sluggish to the user. There are two solutions to this:
    Have the user respond to a group of questions, then hit submit. The occasional lag for page reload won't bother the user.
    Use AJAX to interact with the PHP form processing behind the scenes.
    So yes, you can have one page that responds and changes depending on user input. PHP, javascript and HTML5/CSS3 can all be part of this. The specific way you build your solution will depend on your specific form progress and what technologies you are most comfortable with. For instance, my strong case is PHP, so I let it do as much of the work as possible, but I know coders who do much of what I would do in PHP with javascript, because that's what they are most comfortable using.
    Any resources on how I might be able to do this via PHP?
    PHP Solutions second edition by David Powers
    Programming PHP by Lerdorf, Tatrow and MacIntypre

  • Mapping the CMP Fields with the Database Table using Websphere???

    Hi,
    How to Map the CMP Fields with the Database Table using Websphere
    thru ejb.jar.xml???
    Thanks,
    JavaCrazyLover

    Hi,
    How to Map the CMP Fields with the Database Table using Websphere
    thru ejb.jar.xml???
    Thanks,
    JavaCrazyLover

  • Text field salve in database (BLOB? )

    I'd like that a field (in forms) could hold a text whith format (italic, underline,...).
    And this field can be safe in database oracle. I've searching and I found the type LOB.
    Could I use the field like a BLOB?? How can I link this field and the database?
    Thanks in advance..
         Sueli
    [email protected]

    You can store the file in a blob (it's just binary data) but you won't be able to display it in forms. If you're talking about a word document, you could use ole to invoke word.
    blob fields, in forms, are of type IMAGE (the only type that can be displayed on the canvas). Define your forms field as IMAGE, just make sure you don't map the field to a canvas.
    Regards,
    Bert

  • How do I insert multiple values into different fields in a stored procedure

    I am writing a Stored Procedure where I select data from various queries, insert the results into a variable and then I insert the variables into final target table. This works fine when the queries return only one row. However I have some queries that return multiple rows and I am trying to insert them into different fields in the target table. My query is like
    SELECT DESCRIPTION, SUM(AMOUNT)
    INTO v_description, v_amount
    FROM SOURCE_TABLE
    GROUP BY DESCRIPTION;
    This returns values like
    Value A , 100
    Value B, 200
    Value C, 300
    The Target Table has fields for each of the above types e.g.
    VALUE_A, VALUE_B, VALUE_C
    I am inserting the data from a query like
    INSERT INTO TARGET_TABLE (VALUE_A, VALUE_B, VALUE_C)
    VALUES (...)
    How do I split out the values returned by the first query to insert into the Insert Statement? Or do I need to split the data in the statement that inserts into the variables?
    Thanks
    GB

    "Some of the amounts returned are negative so the MAX in the select statement returns 0 instead of the negative value. If I use MIN instead of MAX it returns the correct negative value. However I might not know when the amount is going to be positive or negative. Do you have any suggestions on how I can resolve this?"
    Perhaps something like this could be done in combination with the pivot queries above, although it seems cumbersome.
    SQL> with data as (
      2        select  0 a, 0 b,  0 c from dual   -- So column a has values {0, 1, 4},
      3  union select  1 a, 2 b, -3 c from dual   --    column b has values {0, 2, 5},
      4  union select  4 a, 5 b, -6 c from dual ) --    column c has values {0, -3, -6}.
      5  --
      6  select  ( case when max.a > 0 then max.a else min.a end) abs_max_a
      7  ,       ( case when max.b > 0 then max.b else min.b end) abs_max_b
      8  ,       ( case when max.c > 0 then max.c else min.c end) abs_max_c
      9  from    ( select  ( select max(a) from data ) a
    10            ,       ( select max(b) from data ) b
    11            ,       ( select max(c) from data ) c
    12            from      dual ) max
    13  ,       ( select  ( select min(a) from data ) a
    14            ,       ( select min(b) from data ) b
    15            ,       ( select min(c) from data ) c
    16            from      dual ) min
    17  /
    ABS_MAX_A  ABS_MAX_B  ABS_MAX_C
             4          5         -6
    SQL>

  • How to creat a Data provider  based on different fields in SAP BW ?

    Hi,
    Experts,
    There are  20 fields  of  Plant Maintainace  like : 
    SWERK
    BEBER
    STORT
    TPLNR
    EQUNR
    INGRP
    QMDAT   ---peroid
    STTXT
    QMDAT  - Date of Notification
    QMNUM
    QMTXT
    QMART
    AUSVN
    AUZTV
    AUSBS
    AUZTB
    AUSZT
    ERNAM
    QMDAB
    AUFNR
    I  want to creat a  Report based upon these fields  ?
    For that I h'v  checked the relevant Fields to the   existing standard  Datasource  in Bw side   &
    Checked  cubes   created  based upon these Datasource  in Bw side !
    i h'v found  some fields are  existing different cubes & some are  missing .
    How to creat a Data provider  based on different fields in SAP BW ?
    plz suggest      !!!!!!!
    Thanx,
    Asit
    Edited by: ASIT_SAP on Jul 15, 2011 6:25 AM
    Edited by: ASIT_SAP on Jul 15, 2011 6:27 AM
    Edited by: ASIT_SAP on Jul 15, 2011 12:37 PM

    Hi Lee, Please see below..
    DECLARE @Machine2 TABLE
    DispatchDate DATE
    INSERT INTO @Machine2 VALUES ('2014/02/01'), ('2014/02/02'), ('2014/02/03')
    DECLARE @DateFrom DATE
    SELECT @DateFrom = DATEADD(D,1,MAX(DispatchDate)) FROM @Machine2
    SELECT @DateFrom AS DateFrom
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • How to get different field in two are more different table using open sql

    Dear all,
              This SenthilMani am very new into sap abap am having doubt in reports how get the different fields from different tables like mara,marc,mard using open sql and native sql program give me some tips to get the data .
    with regards,
    senthil

    HI ,
      1) If u want to select data from more the two table then u can use FOR ALL ENTRIES.
             EX ..Open sql
                       select matnr from mara into table t_mara.
                      select matnr werks from marc into table t_marc for all entries in t_mara where matnr = t_mara-matnr.
      2) U can join more than one table.
               ex:
                   select mara~matnr
                              marc~werks
                    from mara join marc into table t_maramarc
                     on maramatnr = marcmatnr
    3) Using  native sql  ...only u can use JOIN statement

Maybe you are looking for

  • Finder won't open - continually crashes and asks me if I want to reopen windows

    I have no idea how to fix this. It began right after I installed Mavericks on my 2010 Macbook Pro 13". Finder will not open. It keeps crashing with a pop-up window that tells me that Finder isn't working and asking if I want to try to reopen windows

  • Logical and Physical Partioning of an Infocube

    Hi, Can any please explain me the two? Is it different from having aggregates on an Infocube? Thanks

  • Table: Only show XML with a certain value?

    I am building a table from an xml file and it is working great if I ask it to show every node. But I only want the row to be added if it matches a particular value in the xml. For example my xml has values for name, rating and enrollment. So somethin

  • Image size Campus Solutions 8

    Hi people, I´m administrator Peoplesoft Campus Solutions at University. I´m trying to register a picture through the path below: Home > Build Community > Identification Data > Use > Photo But when will register a photo below the error occurs The imag

  • Access Connection 5.5: Max Number of Saved Ports? 3?

    Hi, It appears that Access Connections can only save 3 ethernet ports? Is this by design or is this a bug? If by design, why such a low number? If a bug, please fix this ASAP. Cheers, RocketDude RocketDude T400s 2801-CTO