How do I search for a value in a db?

I have a mysql-db which is connected to a java-program.
It is an applet with a JTextField and a JButton.
When I write something in the JTextField and presses the JButton I want to search for the word in my database and return some other values.
This works properly if I write the exact String.
How shall I do if I want to be able to only write the beginning of the word and retrieve all values that begins with these letters?
Instead of writing "ABC123" I would be able to write "ABC" and retrieve all values that begins with ABC.
Any suggestions?

Yep,
String sql ="select * from tablename where VALUE like '"+textfield.getText()+"%'";That should do.
HTH

Similar Messages

  • How do I search for a value in an Excel sheet using ActixeX

    I am already accessing my excel sheets however I need to be able to search the sheet for a certain value and return the row/cell location. Is there an activeX control that can do this?

    You will need a reference to the range to search. This can be the entire sheet if you wish. Just wire that to the method node Find. Here you can specify all of the typical search options. Wire your string or number into the What input. For the what to LOOKAT value, use -4163 for Value and -4123 for formulas.
    The reference returned is the range of the found value. You can wire it into the property node Row and Column to get the location.
    Michael Munroe
    www.abcdef.biz
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • How do I search for common values across multiple columns?

    I am coordinating a schedule with 5 people across hundreds of dates, and have columns A-E filled with many rows of dates. How can I make a new column that displays all the dates (values) that each person (column) has in common with all the others?
    Is there a simple formula for this?
    thanks!

    Scarampella,
    A second table can be used to find your matching dates.
    Here's an example:
    The formula in Matching Dates is:
    =IF(ISERROR(MATCH(A,Table 1 :: A, 0)+MATCH(A,Table 1 :: B, 0)+MATCH(A,Table 1 :: C, 0)+MATCH(A,Table 1 :: D, 0)+MATCH(A,Table 1 :: E, 0)), "", A)
    Basically, I look for matches in each person's list of dates, and if any fail to produce a match with the date being examined, the result is a miss, and if all match, it's a hit. You can sort the result to get a short list of matches without spaces.
    Regards,
    Jerry

  • How to search for a value in an iterator in Jdev 10.1.2?

    Hi!
    I need to search an iterator named "PermitYrIterator1" for a year value (e.g. 2009) that is stored in bindings.Yr in my jsp. How do I do this in my jsp's DataForwardAction Code) in Jdev 10.1.2?
    I need this in my "Create page." I need to search for this value because I want to check if I should re-execute the "PermitYrIterator1" so that it shows the newly added year in bindings.Yr or not. If bindings.Yr is found in the iterator then I do not need to re-execute the iterator. But if the newly entered year cannot be found then I need to re-execute the iterator.
    I hope you can help me immediately! Thanks!

    Hi,
    Anyone can help me on this please?

  • How to search for multiple values with Bex Prompts

    Hi,
    I would like to know  if it is possible to search for multiple values at the same time with Bex Prompts instead of searching one value at a time (please see the screen shot below). I searched the forum couldn't find any relevant answers. please let me know  how  to achieve?
    Thanks,
    Charvi.

    Hi Charvi,
    You can use wild card search to ensure you get multiple similar values listed as search output.use * for multiple characters and ? for single character.
    For Example, Ravi * would result you all employees with first name as Ravi
    You can use various search formats such as * Ravi * and * Ravi and Ra?? etc.
    Thanks
    Mallik

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • TS4006 My Iphone has been stolen. I have the IMEI number. How do I search for it?

    My Iphone has been stolen. I have the IMEI number. How do I search for it?

    I'm afraid the IMEI number won't do you any good: its principal value is in enabling your service provider to block the phone.
    In order for your iPhone to be locatable you must have enabled the 'Find My Phone' app on it prior to losing it, and it must be on, not wiped, and able to connect to a network. Unless all these conditions are true there is no way of locating it.

  • How do i search for a photo album when i use the search facility on my iPad or iPhone it will not find photo albums of a given name can anyone help

    how do i search for a photo album when i use the search facility on my iPad or iPhone it will not find photo albums of a given name can anyone help

    Photo albums are not searched by Spotlight Search.  Go to Settings > General > Spotlight Search to see and reorder the available search items.
    For more details, see page 12 of the iPad iOS 5.1 User Guide

  • How do I search for all "missing" tracks within the iTunes database?

    I found the dreaded ! of death, and sadly I verified the tacks indeed are not on my hard drive.
    Is there a way to sort on this tag so that I can see what else might be missing on my hard drive but remains in the database (sort of similar to how you can search for all tracks that have missing artwork)? 

    Thanks.  It works perfectly.
    URL for anyone else in need:  http://dougscripts.com/123

  • How do I search for a saved document in Pages on IPad 2?

    I have a lot of docs in my pages app. How can I search for the doc I want?Thanks

    Open the iTunes app > Search > then type the Artist's name

  • How do i search for a specific artist in iTunes store on iPhone 5?

    How do i search for a specific artist in iTunes store on iPhone 5?

    Open the iTunes app > Search > then type the Artist's name

  • When in i-tunes 11 mac, how do i search for a song as well as a genre at the same time?

    when in i-tunes 11 mac, how do i search for a song as well as a genre at the same time?

    If you mean searching for a song that you already have in your Library, then you can select "Music" first. Then, go across horizontally to Genres and select that; then by using the drop-down menu found under "View" & (of course) select "View Options"-- you will be presented with a limited # of choices to sort by.
    My iTunes 11.0.5 shows 4 parameters to choose from: Title, Artist, Year and Rating. Then you can sort & finally...
    Enjoy,
    mm~

  • How do I search for a specific name of an email sender?

    I'm trying to locate, in the easiest way possible, a name that should have appeared in my inbox... How do I search for a specific name?

    type it in the big box on the toolbar and press enter.

  • How do I search for a previous question I posted?

    Hi
    How do I find older questions I had posted on the forum/community?
    I had posted a question a few months prior and had a response.  I'd like to look up that resonse again, but I cannot find it in my history.
    The post is only a few months old, but does not show up in the history of my posts (that I can find).
    How do I search for ALL of my old posts? 

    Click Your Stuff > DIscusssions. This should list all the threads you have contributed to, most recently active first, and paged back to your earliest post.
    If you use the filter for Open Questions or Answered Questions you should see the threads that you started, still open and marked answered respectively.
    If your thread really has disappeared then the usual explanation was that something contentious got added to it and the hosts deceived to evaporate the whole thing.
    tt2

  • How do I search for a word through multiple files in my directories ??

    Hello everyone
    How do I search for a word through multiple files in my directories ??
    I am guessing one tedious way to do it would be to pass all the file names as command line arguments but I"m sure there exist a much easier and faster way to do it.
    Thanks a lot

    You need to pass only the directory name as parameter and then retrieve the files(recursively throug subdirs or not, however you wish) of that directory.
    There were at least 2 threads yesterday on how to retrieve files from directory, and there are many others in the archive so I leave the search part to you ;)
    HTH
    Mike

Maybe you are looking for