package persistlayer;

import java.sql.Connection;
import java.sql.ResultSet;

//This class is the primary persistent (model) layer class. 
//It explicitly communicates with the DbAccessImpl
public class CarPersistImpl {

	//global variables
	DbAccessImpl db = new DbAccessImpl();
	Connection con = db.connect();
	
	public ResultSet getCars() {
		ResultSet rs;
		String query = "SELECT * FROM cars";
		rs = db.retrieve(con, query);
		return rs;
	}
	
}

@@ -336,16 +336,18 @@
 tCars() 
+%0A%09
 %7B%0A%09%09Resu
@@ -445,10 +445,899 @@
 s;%0A%09%7D%0A%09%0A
+  %09public int addCar(String make, String model, int carYear, String color) throws SQLException%0A%09    %7B%0A%09%09String query = %22insert into cars (make, model carYear, color) values (%22 + %22%5C%22%22 + make + %22%5C%22, %22 + %22%5C%22%22 + model + %22%5C%22, %22 + carYear + %22, %22 + %22%5C%22%22 + color + %22%5C%22%22 + %22)%22;%0A%0A%09%09return dbai.create(con, query);%0A%0A%09%09//used to add car in db.%0A%09    %7D%0A    %0A%09    public int deleteCar(String name) throws SQLException%0A%09    %7B%0A%09%09String query = %22delete from cars name = %22 + %22%5C%22%22 + name + %22%5C%22%22;%0A%0A%09%09return dbai.delete(con, query);%0A%09%09//used to delete a single car.%0A%09    %7D%0A    %0A%09    public ResultSet returnSingleCar(String userModel) throws SQLException%0A%09    %7B%0A%09%09ResultSet rs = null;%0A%0A%0A%09%09String query = %22select * from cars where model = %22 + %22%5C%22%22 + userModel + %22%5C%22%22;%0A%0A%09%09rs = dbai.retrieve(con, query);%0A%0A%09%09//used to return single car.%0A%09%09//used when selecting single car on user end.%0A%0A%09%09return rs; %0A%09    %7D%0A%09%0A%09%0A%09%0A%09%0A
 %7D%0A

Update CarPersist