package com.chinacreator.videoalliance.net.dao; import com.frameworkset.common.poolman.PreparedDBUtil; import java.sql.SQLException; import org.springframework.stereotype.Component; @Component public class NetNumberLimitDao { public boolean allowNet(String cpid, String userid) throws SQLException { String sql = "select count(1) from tb_net_limit where cpid=? and userid=? and allownet='1'"; PreparedDBUtil pdb = new PreparedDBUtil(); pdb.preparedSelect("net3g", sql); pdb.setString(1, cpid); pdb.setString(2, userid); pdb.executePrepared(); int cn = pdb.getInt(0, 0); return cn <= 0; } }