@@ -0,0 +1,2607 @@
+package Entity;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A%0A/**%0A *%0A * @author peter%0A */%0A%0A%0A%0Apublic class ListPizzas%0A%7B%0A%0A    /**%0A     * @return the thePizzas%0A     */%0A    public List%3CPizzaObject%3E getThePizzas() %7B%0A        return thePizzas;%0A    %7D%0A%0A    /**%0A     * @param thePizzas the thePizzas to set%0A     */%0A    public void setThePizzas(List%3CPizzaObject%3E thePizzas) %7B%0A        this.thePizzas = thePizzas;%0A    %7D%0A    %0A    public List%3CPizzaObject%3E  thePizzas = new ArrayList%3C%3E();  // Pizzaobject is ONE pizza. This is an array of pizza objects%0A%0A    public ListPizzas() %7B%0A    %7D%0A%0A    public List%3CPizzaObject%3E getPizza(String orderBy) throws InterruptedException %7B%0A        String dbURL = %22jdbc:derby://localhost:1527//home/peter/pizzabase%22;%0A        String tableName = %22pizza%22;%0A        // jdbc Connection%0A        Connection conn = null;%0A        Statement stmt = null;%0A%0A        try%0A        %7B%0A            Class.forName(%22org.apache.derby.jdbc.ClientDriver%22).newInstance();%0A            //Get a connection%0A            conn = DriverManager.getConnection(dbURL); %0A        %7D%0A        catch (ClassNotFoundException cnfe) %7B%0A            System.err.println(%22Derby driver not found.%22);%0A        %7D%0A        catch (InstantiationException %7C IllegalAccessException %7C SQLException except)%0A        %7B%0A            except.printStackTrace();%0A        %7D%0A%0A%0A        try%0A        %7B%0A            stmt = conn.createStatement();%0A            ResultSet results = stmt.executeQuery(%22select * from %22 + tableName + %22 order by %22 + orderBy );%0A%0A            while(results.next())%0A            %7B%0A                PizzaObject po = new PizzaObject();%0A%0A                po.setName(results.getString(1));%0A                po.setDesc(results.getString(2));%0A                po.setPrice((Double) results.getDouble(3));%0A                getThePizzas().add(po);%0A            %7D%0A%0A%0A            results.close();%0A            stmt.close();%0A            %7D%0A            catch (SQLException sql)%0A            %7B%0A                sql.printStackTrace();%0A            %7D%0A%0A            try%0A            %7B%0A                if (stmt != null)%0A                %7B%0A                    stmt.close();%0A                %7D%0A                if (conn != null)%0A                %7B%0A                    DriverManager.getConnection(dbURL);%0A                    conn.close();%0A                %7D           %0A            %7D%0A            catch (SQLException sql)%0A            %7B%0A                sql.printStackTrace();%0A            %7D%0A            %0A        return getThePizzas();%0A    %7D%0A%7D%0A

Create ListPizzas.java