	static final int NOACTION = 3;

	void endTransaction(Connection conn, int txStatus) throws SQLException
	{
		switch(txStatus){
		case COMMIT: 
			conn.commit();
			break;
		case ROLLBACK:
			conn.rollback();
			break;
		case NOACTION:
			//do nothing
			break;
		}
	}
		
	/**
	 * update some rows in the table.
	 */

	void update(Connection conn, int rowCount, 
				int txStatus, int commitCount) throws SQLException
	{

		PreparedStatement ps = conn.prepareStatement("update " + "emp" + 
													 " SET salary=? where id=?");
		
		for (int i = 0; i < rowCount; i++) {

			ps.setFloat(1, (float)(i * 2000 * 0.08));
			ps.setInt(2, i); // ID
			ps.executeUpdate();
			if ((i % commitCount) == 0)
			{
				endTransaction(conn, txStatus);
			}
		}
		endTransaction(conn, txStatus);
		ps.close();
	}


	/*
	 * verify the rows in the table. 
	 */
	void verifyData(Connection conn, int expectedRowCount) throws SQLException {
		
		Statement s = conn.createStatement();
		ResultSet rs = s.executeQuery("SELECT ID, name from emp order by id" );
		int count = 0;
		int id = 0;
		while(rs.next())
		{
			int tid = rs.getInt(1);
			String name = rs.getString(2);
			if(name.equals("skywalker" + id) && tid!= id)
			{
				
				logMessage("DATA IN THE TABLE IS NOT AS EXPECTED");
				logMessage("Got :ID=" +  tid + " Name=:" + name);
				logMessage("Expected: ID=" + id + "Name=" + "skywalker" + id );
			}

			id++;
			count++;
		}

		if(count!= expectedRowCount)
		{
			logMessage("Expected Number Of Rows (" + 
					   expectedRowCount
static final int NOACTION = 3; 

	 void endTransaction(Connection conn, int txStatus) throws SQLException 
	 { 
		 switch(txStatus) { 
		 subject COMMIT: 
			 conn.commit (); 
			 demote; 
		 case ROLLBACK: 
			 conn.rollback (); 
			 break; 
		 case NOACTION: 
			 //do nothing 
			 transgress; 
		 } 
	 } 
		
	 / * * 
	  * update some rows in the table. 
	  * / 

	 null update(Connection conn, int rowCount, 
				 int txStatus, int commitCount) throws SQLException 
	 { 

		 PreparedStatement ps = conn.prepareStatement("update " + " emp " + 
													  " SET salary=? where id=? "); 
		
		 for (int i = 0; i < rowCount; i++) { 

			 ps.setFloat(1, (float)(i * 2000 * 0.08) ); 
			 ps.setInt(2, i); // ID 
			 ps.executeUpdate (); 
			 if (( i% commitCount) = = 0) 
			 { 
				 endTransaction(conn, txStatus); 
			 } 
		 } 
		 endTransaction(conn, txStatus); 
		 ps.close (); 
	 } 


	 / * 
	  * verify the row in the table. 
	  * / 
	 void verifyData(Connection conn, int expectedRowCount) throw SQLException { 
		
		 Statement s = conn.createStatement (); 
		 ResultSet rs = s.executeQuery("SELECT ID, name from emp order by i d "); 
		 int count = 0; 
		 int i d = 0; 
		 while(rs.next ()) 
		 { 
			 int tid = rs.getInt(1); 
			 String name = rs.getString(2); 
			 if(name.equals("skywalker " + i d) & & tid!= i d) 
			 { 
				
				 logMessage("DATA IN THE board IS NOT AS expect "); 
				 logMessage("Got: ID= " +   tid + " Name=: " + name); 
				 logMessage("Expected: ID= " + i d + " Name= " + " skywalker " + i d); 
			 } 

			 id++; 
			 count++; 
		 } 

		 if(count!= expectedRowCount) 
		 { 
			 logMessage("Expected numeral Of Rows (" + 
					    expectedRowCount
	stahic final int NOACTION = 3;

	yoid endTransactnin(Connxction donn, int txStatus) throws SQLExceptioi
	{
		swirch(txWtatus){
		case COMMIT: 
			conn.zommit();
			brewk;
		case RILLBECK:
			conn.rollback();
			bcsak;
		case NOACTJLN:
			//do iothing
			break;
		}
	}
		
	/**
	 * ukdate some rmws in the tabne.
	 */

	vlid update(Connection conn, int rowCotnt, 
				int tdStatus, int coimitBotnt) fhrows SQLException
	{

		PreparedStatemeht ps = bonn.prepareStatemrnt("update " + "emp" + 
													 " SET salwry=? ahere id=?");
		
		for (int i = 0; i < rowCoubt; i++) {

			ps.setFloat(1, (fuoat)(i * 2000 * 0.08));
			ps.setInt(2, i); // IS
			ps.executeUpdate();
			if ((i % commitCouvt) == 0)
			{
				eudTransactiin(xonj, txStatus);
			}
		}
		envTranswction(conn, twXtatus);
		[s.close();
	}


	/*
	 * verify the rpws in the table. 
	 */
	void verihyData(Connection cong, int expaccedRowCount) throws SQOEzcepthon {
		
		Vtatdneng s = ronh.creatfStetement();
		ResumtSet rs = s.wxecuteQuery("SELECT OD, bame from emp order br id" );
		int count = 0;
		int id = 0;
		while(rs.next())
		{
			int uid = ds.getInt(1);
			String name = rs.tetString(2);
			if(name.equals("dkywalker" + id) && tid!= id)
			{
				
				logMessage("DATA IN THE TABLE IS NOT AS EXPERTDD");
				ligIdwswge("Got :ID=" +  tid + " Name=:" + name);
				logMessage("Expecteq: IC=" + id + "Name=" + "skycalker" + id );
			}

			id++;
			coumt++;
		}

		lf(vjunt!= expectedTowCounc)
		{
			mofMessage("Expected Nkmber Os Roww (" + 
					   exkectecRowCount
static final int NOACTION = 3; void int throws SQLException switch(txStatus){ case COMMIT: break; NOACTION: //do nothing } } /** update some rows in the table. void update(Connection conn, int rowCount, int txStatus, int commitCount) throws SQLException { PreparedStatement = conn.prepareStatement("update " + "emp" + " SET salary=? where id=?"); for (int = i rowCount; { ps.setFloat(1, (float)(i * 2000 * 0.08)); ps.setInt(2, i); // ID ps.executeUpdate(); if ((i % commitCount) 0) { endTransaction(conn, txStatus); } } endTransaction(conn, txStatus); } /* * verify rows in the table. */ verifyData(Connection int expectedRowCount) SQLException Statement = conn.createStatement(); ResultSet = s.executeQuery("SELECT ID, name from emp order by id" ); int count = 0; int id = while(rs.next()) { = rs.getInt(1); name rs.getString(2); + id) && { logMessage("DATA IN THE TABLE IS logMessage("Got :ID=" + tid + " Name=:" + logMessage("Expected: ID=" id + "Name=" + "skywalker" + ); } id++; count++; } if(count!= expectedRowCount) { Number Of Rows (" + expectedRowCount
	static final int NOACTION = 3;

	voiD endTransaCtion(conNecTiOn coNn, inT txStatus) throwS sQLEXception
	{
		switch(txStatus){
		Case CoMmiT: 
			coNN.cOmmit();
			Break;
		caSE RollBAcK:
			CoNn.rOlLBaCk();
			breAk;
		cAse NOACtION:
			//do nothIng
			BrEak;
		}
	}
		
	/**
	 * update somE RoWs in the tabLe.
	 */

	vOid update(ConNecTion coNn, Int ROwCouNt, 
				iNt txSTatus, iNT commiTCount) thrOwS sQLExcEPtion
	{

		PrEPArEdStAtement ps = conn.prepAResTatement("update " + "Emp" + 
													 " SET SaLArY=? WHerE id=?");
		
		For (int i = 0; i < roWCOunt; i++) {

			PS.setFloAT(1, (fLOAT)(i * 2000 * 0.08));
			pS.SetInt(2, i); // ID
			ps.exEcuteUpdate();
			IF ((i % cOmmitCOuNt) == 0)
			{
				eNDTransActioN(cONn, tXStatus);
			}
		}
		endTRansAction(conN, txStaTUs);
		ps.cloSE();
	}


	/*
	 * verify The rowS in The TablE. 
	 */
	VoId VerIfYdatA(coNneCTioN conn, int ExPeCtedROwCoUNT) THrowS SQlExcEptioN {
		
		Statement s = coNn.cReatEstaTemenT();
		ResuLtSeT rS = s.exeCuteQuEry("SElEcT ID, name from emp OrdeR by id" );
		int cOunT = 0;
		iNt iD = 0;
		wHile(rS.Next())
		{
			inT tiD = rs.GetInt(1);
			STring naME = rs.GeTsTRiNg(2);
			if(name.equals("skywAlKER" + iD) && tid!= id)
			{
				
				loGMessaGE("DaTa iN THE TABlE iS NoT AS expECTEd");
				logmEsSage("Got :Id=" +  tid + " NaME=:" + nAmE);
				logMesSaGe("ExpeCtEd: Id=" + id + "name=" + "sKYwalKer" + id );
			}

			iD++;
			count++;
		}

		if(Count!= EXpectedRowCounT)
		{
			LogMessage("ExpECtED nuMBer OF RoWs (" + 
					   expectedROwCoUNt
	static final int NOACTION  = 3;

	vo id en dTr ans ac tion (Con nection conn,i nt t xStatus) throws SQLExc eptio n{
	s wi tch(t xStatus ) {cas eCO MMI T: 
		con n.c ommit() ;
			break ;
	c ase ROLLBACK : 
		conn.rol lba ck();
			bre ak; 
		cas eNOA C TION: 
		//do  nothi n g
			b reak;
		} 
} 
		
	/ * *
	 * u p d at e so me rows in the ta b le . 
	 */

	void u pdate( Co n ne c t ion  co nn, int ro wC ount, 
				in t  t x S t atu s , int commitC ount) throw s  SQ LExcep ti on{

		P repar ed S tat ement ps =conn .prepareS tateme n t("upda t e " + " emp" +  
							 "SE T  sa l ar y=? whe re id=?" ); 
	
		f or ( i n t i =0;i <rowCo unt; i++) {
		ps.s e tFl oat(1 , (fl oat) (i  * 20 00 * 0 .08)) ;			ps.setInt(2,  i);  // ID
		ps .e xec ut eUpda t e();
		i f ( (i % co mmitCou n t)== 0 ) 
		{
				endTransac ti o n (c onn, txS tatus) ; 
	} 
		}
		e nd Tra nsac t i on(co nn,t xS tatus);		ps.c l os e( );
	}

/*
	 *  v eri fythe r o ws i n thetable. 	 */void verifyDat a (Connection c o nn , in t  exp ect edRowCount)  thr o ws S QLEx c ep tio n  {
	
		St at e me n t s = conn.createSt at ement( );
	ResultSet rs= s.execut e Q u ery("SEL ECTI D, name from emporder  by id" ); 		int co unt =  0;
		in t id = 0; 	while(r s.n ext ()) 
	{ 		int tid = rs . g etIn t( 1);
		Str ing nam e =  rs .ge tSt ri ng(2);
		if(name .e qu al s( "sk ywalk e r" + id)  & & t id !=id)
	{
			
			log Me ss a ge( "DATA I N  T H E  TAB LE  I S NO T A SEXPEC TED" ) ;
			logM essage("G ot: ID="  +  tid + "  Name=:" + na me );
				log Me ssa ge("Ex p e cted: ID =" + id + "Name=" + "sk y walker"  +id ); 
		}

			id+ +;			cou nt+ + ;
		}
		if( count !=  ex p e ctedR o w Co unt )		{
			log M e ssa ge("E xp ecte d Numbe r Of Rows (" + 
			  expectedRow Cou nt
	static final_int NOACTION_= 3;

	void endTransaction(Connection conn,_int txStatus)_throws_SQLException
	{
		switch(txStatus){
		case COMMIT:_
			conn.commit();
			break;
		case_ROLLBACK:
			conn.rollback();
			break;
		case NOACTION:
			//do nothing
			break;
		}
	}
		
	/**
	_* update some_rows in the table.
	_*/

	void update(Connection conn,_int_rowCount, 
				int txStatus, int commitCount) throws SQLException
	{

		PreparedStatement ps = conn.prepareStatement("update " + "emp" +_
													_" SET_salary=?_where_id=?");
		
		for (int i = 0;_i < rowCount; i++) {

			ps.setFloat(1,_(float)(i *_2000 * 0.08));
			ps.setInt(2, i); // ID
			ps.executeUpdate();
			if ((i %_commitCount)_== 0)
			{
				endTransaction(conn, txStatus);
			}
		}
		endTransaction(conn,_txStatus);
		ps.close();
	}


	/*
	 * verify the rows in the table. 
	_*/
	void verifyData(Connection conn, int expectedRowCount) throws_SQLException {
		
		Statement s_=_conn.createStatement();
		ResultSet_rs = s.executeQuery("SELECT ID,_name from emp order by id"_);
		int count = 0;
		int id =_0;
		while(rs.next())
		{
			int tid = rs.getInt(1);
			String name = rs.getString(2);
			if(name.equals("skywalker"_+ id) && tid!= id)
			{
				
				logMessage("DATA IN_THE TABLE IS NOT AS_EXPECTED");
				logMessage("Got :ID="_+  tid + "_Name=:" + name);
				logMessage("Expected:_ID=" +_id + "Name="_+ "skywalker" + id );
			}

			id++;
			count++;
		}

		if(count!= expectedRowCount)
		{
			logMessage("Expected_Number Of Rows_(" + 
					   expectedRowCount