A few words of advice...a) better practice to avoid mixind your sql statements with your view. Create a class or a bean which does this for you. b) Don't select everything from the database...use a...