alexandra84

Untitled

Nov 1st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. case 1:
  2. System.out.println("Please input the customer name what you want to change:");//Enter the code that needs to run if 1 was the option choosed.
  3. customerName2 = input.nextLine();
  4. System.out.println(customerName2);
  5. DB.selectSQL("SELECT fldCustomerName, fldCustomerID FROM tblCustomer WHERE fldCustomerName='"+customerName2+"';");//
  6. do {
  7. String data = DB.getDisplayData();
  8. if (data.equals(DB.NOMOREDATA)) {
  9. break;
  10. } else
  11. System.out.print(data);
  12. }
  13. while (true);
  14. System.out.println("Insert Customer ID");
  15. customerID = input.next();
  16. System.out.println("Insert New Name");
  17. input.nextLine();
  18. customerName1 = input.nextLine();
  19. //Update data in Customer Na3me field
  20. //DB.updateSQL("UPDATE tblCustomer SET fldCustomerName=","'+ customerName1 +'","WHERE fldCustomerName=","'+ customerName2 +'");
  21. if (customerName1.length()>0) {
  22. DB.updateSQL("UPDATE tblCustomer SET fldCustomerName='" + customerName1 + "' WHERE fldCustomerID='" + customerID + "'");
  23. System.out.println("Customer number " + customerID + " has his name changed to " + customerName1);
  24. }
  25. break;
Advertisement
Add Comment
Please, Sign In to add comment