forms related condition based

Hi I have a formbean which is submitting one user out of 10 user to my action class.

Now In database there is one table which conatins multiple rows.But out of all rows only some rows are shown to user depending upon the user.

now the problem is

I have to write a class where I will get the user name and on the basis of that name I have to fetch data from table.

so how to get this user name from form bean and based on this user condition how to fetch data.

if any once help on this condiation based code.it would be of great help.

[571 byte] By [smita_smitaa] at [2007-10-3 1:31:36]
# 1
1: get the user name.Isn't it in your form bean? 2: Run a database query select * from myTable where user = ?Whats so hard about that?
evnafetsa at 2007-7-14 18:29:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
no.I could not expain properly.i am geting the user name by form.getUser()Now I have to write a code for this getting user realted data in action class.so should i write like getUser().getData(); i dont think so
smita_smitaa at 2007-7-14 18:29:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

SearchForm searchform=(SearchForm) form;

String name=searchForm.getName

ok from here I got the username.Now based on this username I have to recive the user related data.

I have one method in database getallThings().

now I have to get data according to user and things related to him

smita_smitaa at 2007-7-14 18:29:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> SearchForm searchform=(SearchForm) form;

> String name=searchForm.getName

>

> ok from here I got the username.Now based on this

> username I have to recive the user related data.

> I have one method in database getallThings().

> now I have to get data according to user and things

> related to him

Read evnafets reply again - write a new method that has a query with q where clause.

Or use the existing getAllThings() methods and remove the redundant data from the Collection or the array that this object returns.

ram.

Madathil_Prasada at 2007-7-14 18:29:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi env and mathsgot your the things.let me check.I the things work.once again will mail you.it may take three daysthanxs
smita_smitaa at 2007-7-14 18:29:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...