1 9 package com.ziclix.python.sql.handler; 10 11 import com.ziclix.python.sql.DataHandler; 12 import com.ziclix.python.sql.FilterDataHandler; 13 import com.ziclix.python.sql.zxJDBC; 14 import org.python.core.Py; 15 16 import java.sql.SQLException ; 17 import java.sql.Statement ; 18 19 34 public class UpdateCountDataHandler extends FilterDataHandler { 35 36 private static boolean once = false; 37 38 41 public int updateCount; 42 43 47 public UpdateCountDataHandler(DataHandler datahandler) { 48 49 super(datahandler); 50 51 if (!once) { 52 Py.writeError("UpdateCountDataHandler", zxJDBC.getString("updateCountDeprecation")); 53 once = true; 54 } 55 56 this.updateCount = -1; 57 } 58 59 62 public void preExecute(Statement stmt) throws SQLException { 63 64 super.preExecute(stmt); 65 66 this.updateCount = -1; 67 } 68 69 72 public void postExecute(Statement stmt) throws SQLException { 73 74 super.postExecute(stmt); 75 76 this.updateCount = stmt.getUpdateCount(); 77 } 78 } 79 | Popular Tags |