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

📄 jddaoimpl.java

📁 JAVA E拍网上购物业务管理 使用CRM业务流程
💻 JAVA
字号:
package org.ch02zf.dao.daoImpl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.jsp.jstl.sql.Result;

import org.ch02zf.dao.JDDao;
import org.ch02zf.entity.JD;
import org.ch02zf.entity.QX;

public class JDDaoImpl implements JDDao {

	public Result getJD() {
		// TODO Auto-generated method stub
		CommonDao cd = new CommonDao();
		cd.setConn(BasicDao.getCon());
		String sqlvalue = "select * from tbl_jd order by qxid ";
		cd.setSqlvalue(sqlvalue);
		Result result = null;
		try {
			result = cd.executeQuery();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
	}

	public List getJDNums() {
		// TODO Auto-generated method stub
		CommonDao cd = new CommonDao();
		cd.setConn(BasicDao.getCon());
		String sqlvalue = "select count(*) as num from tbl_jd group by qxid order by qxid ";
		cd.setSqlvalue(sqlvalue);
		Result result = null ;
		List list = new ArrayList();
		try {
			result = cd.executeQuery();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		for(Map item:result.getRows())
		{
			list.add((Integer)item.get("num"));
		}
		return list;
	}

	public JD getJDbyId(int jdid) {
		// TODO Auto-generated method stub
		CommonDao cd  = new CommonDao();
		cd.setConn(BasicDao.getCon());
		String sql = "select * from tbl_jd where jdid = "+jdid+"order by qxid ";
		cd.setSqlvalue(sql);
		Result result = null;
		JD jd = new JD();
		try {
			result = cd.executeQuery();
			if(result.getRowCount()>0)
			{
				jd.setJdid((Integer)result.getRows()[0].get("jdid"));
				jd.setQxid((Integer)result.getRows()[0].get("qxid"));
				jd.setJd((String)result.getRows()[0].get("jd"));
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return jd;
	}

}

⌨️ 快捷键说明

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