when user key in data into first textfield , and the remaining second and third textfield automatically display out the value based on first textfield 's data , the display data in 2nd, 3rd textfield's data are query from DB and first textfield belong to primary key
Or you could have the values that are going to fill in the textfields in the scope of the page(request object most likely) in a vector and iterate through the vector based on the entry in the first textfield, I would suggest using a drop down menu instead of a textfield, that way you can streamline entries made in to the first field.
SCJP 1.4, SCWCD 1.4
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler et al, Refactoring: Improving the Design of Existing Code, 1999
One would be to use AJAX to make a call to the server when the first field is selected or filled out.
Another is to submit whole form after the first field is filled out, query the database, and redraw the whole page with the results. I have an example app that does this on http://simple.souther.us/not-so-simple.html. Look for DynamicSelectLists.
All of this assumes a strong knowledge of JSP/Servlets and web programming in general.