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

📄 merchantbizgroupjoindao.java

📁 基于struts的网上商店源码
💻 JAVA
字号:
/*
 * 作者:刘云云
 * 时间:2007年11月28日
 * 功能: 处理商家的商圈请求
 */
package com.mole.struts.dao;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Iterator;

import com.mole.struts.bean.MerchantBizGroupJoinBean;

public class MerchantBizGroupJoinDAO extends AbstractDAO {
	// 获取商圈请求的商家成员的记录集
	public MerchantBizGroupJoinBean[] getBizGroupMember(String sql) {
		ArrayList<Object[]> arrayList = executeQuery(sql);
		MerchantBizGroupJoinBean[] records = new MerchantBizGroupJoinBean[arrayList
				.size()];
		Iterator<Object[]> it = arrayList.iterator();
		int i = 0;
		while (it.hasNext()) {
			Object[] obj = it.next();
			MerchantBizGroupJoinBean record = new MerchantBizGroupJoinBean();
			record.setName(obj[0].toString());
			record.setTypeName(obj[1].toString());
			record.setCityName(obj[2].toString());
			record.setAreaName(obj[3].toString());
			record.setDescription(obj[4].toString());
			record.setJoinDate(obj[5].toString().substring(0, 10));
			record.setId(obj[6].toString());
			record.setTypeName2(obj[7].toString());
			record.setTypeName3(obj[8].toString());
			record.setTypeName4(obj[9].toString());
			records[i++] = record;
		}
		return records;
	}

	// 同意一条商圈请求(存储过程)
	public int executeJoinPro(String bizgroupId, String storeId,
			String description) throws Exception {
		CallableStatement stmt = null;
		Connection conn = getConn();
		try {
			conn.setAutoCommit(true);
			stmt = conn.prepareCall("{call sp_BizGroupJoin(?,?,?)}");
			stmt.setString(1, bizgroupId);
			stmt.setString(2, storeId);
			stmt.setString(3, description);
			stmt.executeUpdate();
			return 1;
		} finally {
			if (stmt != null)
				stmt.close();
		}
	}
}

⌨️ 快捷键说明

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