public int executeUpdate ( String cmd , Transaction tx ) { if ( tx . isReadOnly ( ) ) throw new UnsupportedOperationException ( ) ; Parser parser = new Parser ( cmd ) ; Object obj = parser . updateCommand ( ) ; if ( obj . getClass ( ) . equals ( InsertData . class ) ) { Verifier . verifyInsertData ( ( InsertData ) obj , tx ) ; return uPlanner . executeInsert ( ( InsertData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( DeleteData . class ) ) { Verifier . verifyDeleteData ( ( DeleteData ) obj , tx ) ; return uPlanner . executeDelete ( ( DeleteData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( ModifyData . class ) ) { Verifier . verifyModifyData ( ( ModifyData ) obj , tx ) ; return uPlanner . executeModify ( ( ModifyData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( CreateTableData . class ) ) { Verifier . verifyCreateTableData ( ( CreateTableData ) obj , tx ) ; return uPlanner . executeCreateTable ( ( CreateTableData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( CreateViewData . class ) ) { Verifier . verifyCreateViewData ( ( CreateViewData ) obj , tx ) ; return uPlanner . executeCreateView ( ( CreateViewData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( CreateIndexData . class ) ) { Verifier . verifyCreateIndexData ( ( CreateIndexData ) obj , tx ) ; return uPlanner . executeCreateIndex ( ( CreateIndexData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( DropTableData . class ) ) { Verifier . verifyDropTableData ( ( DropTableData ) obj , tx ) ; return uPlanner . executeDropTable ( ( DropTableData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( DropViewData . class ) ) { Verifier . verifyDropViewData ( ( DropViewData ) obj , tx ) ; return uPlanner . executeDropView ( ( DropViewData ) obj , tx ) ; } else if ( obj . getClass ( ) . equals ( DropIndexData . class ) ) { Verifier . verifyDropIndexData ( ( DropIndexData ) obj , tx ) ; return uPlanner . executeDropIndex ( ( DropIndexData ) obj , tx ) ; } else throw new UnsupportedOperationException ( ) ; }
Executes an SQL insert delete modify or create statement . The method dispatches to the appropriate method of the supplied update planner depending on what the parser returns .