⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 auctionshopcache.java

📁 源码/软件简介: 云网论坛1.1RC国际版是采用JSP开发的集论坛、CMS(网站内容管理系统)、博客、聊天室、商城、交友、语音灌水等于一体的门户式社区。拥有CWBBS ( Cloud Web BBS
💻 JAVA
字号:
package com.redmoon.forum.plugin.auction;

import cn.js.fan.base.ObjectCache;
import cn.js.fan.db.Conn;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class AuctionShopCache extends ObjectCache {
    String prefix = "AuctionShopId_";

    public AuctionShopCache() {
        super();
    }

    public AuctionShopCache(AuctionShopDb auctionShopDb) {
        super(auctionShopDb);
    }

    public String getShopUserNameById(int id) {
        String userName = (String) rmCache.get(prefix + id);
        if (userName == null) {
            ResultSet rs = null;
            Conn conn = new Conn(connname);
            try {
                String sql = "select userName from " + objectDb.getTableName() +
                             " where id=?";
                PreparedStatement ps = conn.prepareStatement(sql);
                ps.setInt(1, id);
                rs = conn.executePreQuery();
                if (rs.next()) {
                    // shopName,address,tel,desciprtion,isValid,reason
                    userName = rs.getString(1);
                    try {
                        rmCache.put(prefix + id, userName);
                    } catch (Exception e) {
                        logger.error("getShopUserNameById1:" + e.getMessage());
                    }
                }
            } catch (SQLException e) {
                logger.error("getShopUserNameById2:" + e.getMessage());
            } finally {
                if (conn != null) {
                    conn.close();
                    conn = null;
                }
            }
        }
        return userName;
    }

    public void setGroup() {
        group = "AUCTIONSHOP";
    }

    public void setGroupCount() {
        COUNT_GROUP_NAME = "AUCTIONSHOPCOUNT";
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -