Can I match a value entered in textfield with two column in the database.
It is required in a application which has options of “Save” and “search” according to the id but id is in combined form of String and Integer (eg abc/345) and the next id is incremented version of last id ie abc/346,abc/347 So I create two columns to store id in database , first for string part and second for integer part
problem is that When I enter full id ie abc/345 in textfield and click on the “Search button” then the other fields should be fill according to this full id
This could be a solution:
Use the
getText()method ofTextfieldto get the id (string/int) and use aStringTokenizerto split the id in two parts: string and id.Then you can easily query the database with these two requirements..
Code sample: