public void UpdateCustomer(Customer customer) throws CustomerHomeException, ClassNotFoundException{
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Mydb";
String user = "user1";
String password = "password";
Connection con = DriverManager.getConnection(url,user,password);
PreparedStatement smt= con.prepareStatement("update customer SET ssn = ? customer_name = ? where ssn = ?");
if(getCustomer.equals(customer.getSocialSecurityNumber()))
smt.setString(1,customer.getSocialSecurityNumber());
smt.setString(2, customer.getName());
smt.setString(3, customer.);
smt.executeUpdate();
smt.close();
con.close();
}
catch (SQLException e){
throw new CustomerHomeException("Failed to create CustomerHome", e);
}
}
but I am confused how can i retrieve value for existing ssn. Also I have a method getCustomers to retrieve a particular customer separately. Will that help