| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package QCM.COMMUNAL;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.util.ArrayList;
- import com.sun.java_cup.internal.internal_error;
- import CoreFS.SA01.CoreIComponent;
- public class sqlCount extends CoreIComponent {
- int count = 0;
- ResultSet rs = null;
- StringBuffer sqlucomm = null;
- /**
- * count
- * @param
- * @param
- * @param
- * @param
- * @return
- */
- public int countData(String chart, String row, String rowValue,
- Integer VALIDFLAG) {
- sqlucomm = new StringBuffer();
- sqlucomm.append("select count(1) count from " + chart + " where "
- + row + "='" + rowValue + "' ");
- if (VALIDFLAG != null) {
- sqlucomm.append(" and VALIDFLAG='" + VALIDFLAG + "'");
- }
- try {
- rs = this.getDao("KgDao").ExceuteQueryForResultSet(
- sqlucomm.toString());
- if (rs.next()) {
- count = rs.getInt("count");
- }
- } catch (SQLException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return count;
- }
- }
|