22e4c107412d89700288c171f3262f3967c9ae52.svn-base 634 B

1234567891011121314151617181920212223
  1. package com.chinacreator.videoalliance.net.dao;
  2. import com.frameworkset.common.poolman.PreparedDBUtil;
  3. import java.sql.SQLException;
  4. import org.springframework.stereotype.Component;
  5. @Component
  6. public class NetNumberLimitDao
  7. {
  8. public boolean allowNet(String cpid, String userid)
  9. throws SQLException
  10. {
  11. String sql = "select count(1) from tb_net_limit where cpid=? and userid=? and allownet='1'";
  12. PreparedDBUtil pdb = new PreparedDBUtil();
  13. pdb.preparedSelect("net3g", sql);
  14. pdb.setString(1, cpid);
  15. pdb.setString(2, userid);
  16. pdb.executePrepared();
  17. int cn = pdb.getInt(0, 0);
  18. return cn <= 0;
  19. }
  20. }