package com.monkeygarage.carclubhub.clubinfo;
import java.sql.ResultSet; 
import java.sql.SQLException; 
import java.util.logging.Logger;
import com.monkeygarage.DBConnect;
import java.util.logging.Level;
import java.util.*;

public class Search 

	private List<SearchResults> list = new ArrayList<SearchResults>(); 
	DBConnect db = new DBConnect(); 
		public Iterator getResult() {
		return list.iterator();
	private void Result()
		try {
			ResultSet rs = db.getResult("SELECT club.clubId, " +
					"club.clubName, club.clubDescrip, " +
					"clubaddress.zipcode, state.stateName FROM club, " +
					"clubaddress, state WHERE clubaddress.stateId=38 " +
					"AND clubaddress.clubId = club.clubId AND " +
					"clubaddress.stateId = state.stateId");
			list = new ArrayList();
				list.add(new SearchResults(rs.getLong(1), rs.getString(2),
		catch (SQLException ex) {LOGGER.log(Level.SEVERE, "Error", ex);}
			{ db.disconnect(); } 
	private static final Logger LOGGER = Logger.getLogger(Search.class.getName());
	public static void main(String[] args) {
		Search list = new Search();
		Iterator it = list.getResult();


package com.monkeygarage.carclubhub.clubinfo;

public class SearchResults {
	private Long clubId;
	private String clubName;
	private String clubDescrip;
	private Long zipcode;
	private String stateName;
	SearchResults(Long clubId, String clubName,
	String clubDescrip,
	Long zipcode,
	String stateName)
	public Long getClubId(){
		return clubId;
	public String getClubName(){
		return clubName;
	public String getClubDescrip(){
		return clubDescrip;
	public Long getZipcode(){
		return zipcode;
	public String getStateName(){
		return stateName;
	public Long toLong() { return this.clubId; }
	public String toString() { return this.clubName; }
	public String toString() { return this.clubDescrip; }
	public Long toLong() { return this.zipcode; }
	public String toString() { return this.stateName; }

obviously I'm getting errors from the last 5 lines in SearchResults.

I'm trying to get

public static void main(String[] args) {
		Search list = new Search();
		Iterator it = list.getResult();

to actually output the results, but I'm a little confused as to how, and I also wanted to make sure I was using generics correctly, though I don't think I am.

can an arraylist hold a table of items similiar to the results of a mysql request? I've got 5 items coming out of the request, and from everything I see about ArrayList, it gives you a an "id" column and an "item" column...