package com.chinacreator.process.dao; import java.sql.SQLException; import org.apache.commons.lang.math.NumberUtils; import org.springframework.stereotype.Component; import com.chinacreator.process.util.DataSource; import com.frameworkset.common.poolman.SQLExecutor; @Component public class ChangshiBlackDao { public boolean isBlackUser(String userid,String cpid) throws SQLException{ String sql = "select count(1) from TB_CHANGSHIBLACK_INFO where userid =? and cpid=? and status=0"; return NumberUtils.toLong(SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql, userid,cpid)) > 0; } public static void main(String[] args) throws SQLException { ChangshiBlackDao dao = new ChangshiBlackDao(); System.out.println(dao.isBlackUser("18507102049","changshis")); } }