Part A: Purpose: This laboratory provides some experience working with the C++ programming language that has an SQL query and SQL update embedded in it. Procedure: Follow the instructions below. Be sure to load the C++ to ProQueryExample code presented in the Appendix A below. In your ProQueryExample.cpp source file, modify the source code so that it changes the customer balance of Streaming Direct from $210.40 to $337.26. Rerun the query in step 3 above. Modify the source to return the balance of Streaming Direct to $210.40. Rerun the query in step 3 above. Print out a copy of your output. Submit a cover sheet, a copy of your output, and the source code that you used to obtain it. Follow any additional instructions that your instructor may give you. Appendix A /* * Name: ProQueryExample.cpp * * Description * This source code displays a join of the invoice and * customer tables. In addition this source code updates the Streaming * Direct customer name to Direct Sports and then returns the name back * to Streaming Direct. * * Remarks: * Author Date Comment * Mike Lukens 08/08/2008 initial code * */ #include #include #include using namespace oracle::occi; using namespace std; class occiIntf { public: //constructor occiIntf ( string login, string password, string dbStr ) { //setup the environment which Oracle requires environ = Environment::createEnvironment ( Environment::DEFAULT ); try { //create a connection to the database connect = environ->createConnection ( login, password, dbStr ); } catch ( SQLException excpt ) { cout << "Exception thrown by createConnection" << endl; cout << "Error code: "<< excpt.getErrorCode ( ) << endl; cout << excpt.getMessage ( ) << endl; system ( "pause" ); exit ( 1 ); } } //destructor ~occiIntf ( ) { //make sure to clean up the connection and the environment when //we are done! environ->terminateConnection ( connect ); Environment::terminateEnvironment ( environ ); } //update a field void updateField ( string name, string id ) { //change the customer name to/from Direct Sports in CUSTOMER table string sqlStatmt = "UPDATE customer SET cust_name = :x WHERE cust_id = :y"; statmt = connect->createStatement ( sqlStatmt ); try { //substitute the customer name and id into the SQL statement statmt->setString ( 1, name ); statmt->setString ( 2, id ); statmt->executeUpdate (); cout << "Update succeeded\n" << endl; } cat.