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

📄 daocstlostdao.java

📁 J2EE客户关系管理系统!!!!!!!!!!!!!!!!!!!!
💻 JAVA
字号:
package com.accp.DAO;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.accp.VO.VOCstLostVO;
import com.accp.DB.DBConnection;


public class DAOCstLostDAO {
	public List<VOCstLostVO> findBy(String str){
		List ls = new ArrayList();
		Connection con = DBConnection.getConnection();
		PreparedStatement ps = null;
		ResultSet rs = null;
		String sql = "select lst_cust_name from cst_lost where 1=1 and lst_cust_name like '%"+str+"%'";
		try {
			ps = con.prepareStatement(sql);
			rs = ps.executeQuery();
			while(rs.next()){
				VOCstLostVO cstlostvo = new VOCstLostVO();
				cstlostvo.setLstCustName(rs.getString(1));
				ls.add(cstlostvo);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			DBConnection.ConnectionClose(con);
		}
		return ls;
	}
	
	public List<VOCstLostVO> findBy1(){
		List ls = new ArrayList();
		Connection con = DBConnection.getConnection();
		PreparedStatement ps = null;
		ResultSet rs = null;
		String sql = "select lst_cust_name from cst_lost where 1=1";
		try {
			ps = con.prepareStatement(sql);
			rs = ps.executeQuery();
			while(rs.next()){
				VOCstLostVO cstlostvo = new VOCstLostVO();
				cstlostvo.setLstCustName(rs.getString(1));
				ls.add(cstlostvo);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			DBConnection.ConnectionClose(con);
		}
		return ls;	
	}
}

⌨️ 快捷键说明

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