public void doWork() {

	   Connection conn = null;
	   ResultSet rs = null;
	   try {
		 conn = getConnection(dbUrl,properties);

		 if(conn == null)
		 	throw new Exception("Failed to obtain connection!");

		 conn.setAutoCommit(true);

		 // Setting isolation level to read uncommitted, since this is a sample application.
		 // Please set the isolation level depending on the requirements of your application
		 setIsolationLevel(conn,Connection.TRANSACTION_READ_UNCOMMITTED);

		 prepareStmts(conn);

		 // Perform the DML operations
		 for (int i=0; i<NsSample.ITERATIONS; i++) {
			 // Choose between either a select or any one of (insert or update or delete ) operation
			 int choice = (int) (Math.random() * 100) % 2;
			 switch (choice) {
				 case 0: { //select a row
					rs = getMaxKey.executeQuery(); //gets max t_key value
					long selectWhere = 0;
					if(rs.next()) {
						selectWhere = rs.getLong(1);
					}
					int numSelected = doSelectOperation(selectWhere);
					break;
				 }

				 case 1: { //do an insert, update or delete
					doIUDOperation();
					break;
				 }
			 } //end of switch()
		 }//enf of for()

	   } catch(Exception e) {
		   pw.println("[NsSampleWork] Thread id - "+ thread_id + "; error when performing dml operations; ");
		   e.printStackTrace();
	     } finally {
		   	try {
				if(rs != null)
					rs.close();

				closeConnection(conn);
				cleanup();
		    } catch(Exception ee) {
			   pw.println("[NsSampleWork] Thread id - " + thread_id+"; error when cleaning up connection, resultset; exception is ");
			   ee.printStackTrace();
		      }
	       }
	 }//end of method doNsSampleWork()