Binding a Table to a Combo Box for selection.


I have looked for this (hopefully) simple procedure but have yet to find it so I’m asking now.

I have a Combobox and a mysql table called YearsProduced. The table has 2 columns. The ID and Year. I want to display the years for selection in a Combobox.

What I have done that gives me the first column only. Ignore the system prints they were just a quick way to see where I was getting to without going into debug.

            SQLContainer container = null;
            System.out.println("Client View 1");
			try {
				JDBCConnectionPool pool = new SimpleJDBCConnectionPool("com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/buds", "userxxxx", "pwdxxxxxxx");

TableQuery tq = new TableQuery(“YearsProduced”, pool);

				container = new SQLContainer(tq);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
			} catch (Exception e){
				System.out.println("ERROR: " + e.getMessage());
			System.out.println("Client View 2");

System.out.println(“Client View 3”);

Any Ideas??? Thanks.