Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 1:
- 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.
- customerName2 = input.nextLine();
- System.out.println(customerName2);
- DB.selectSQL("SELECT fldCustomerName, fldCustomerID FROM tblCustomer WHERE fldCustomerName='"+customerName2+"';");//
- do {
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)) {
- break;
- } else
- System.out.print(data);
- }
- while (true);
- System.out.println("Insert Customer ID");
- customerID = input.next();
- System.out.println("Insert New Name");
- input.nextLine();
- customerName1 = input.nextLine();
- //Update data in Customer Na3me field
- //DB.updateSQL("UPDATE tblCustomer SET fldCustomerName=","'+ customerName1 +'","WHERE fldCustomerName=","'+ customerName2 +'");
- if (customerName1.length()>0) {
- DB.updateSQL("UPDATE tblCustomer SET fldCustomerName='" + customerName1 + "' WHERE fldCustomerID='" + customerID + "'");
- System.out.println("Customer number " + customerID + " has his name changed to " + customerName1);
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment