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

📄 lxrxxdaoimpl.java~11~

📁 客户关系管理系统,包括数据库,类,所有运行所需的代码及文件
💻 JAVA~11~
字号:
package com.dao;

import java.util.List;
import com.tool.JDBConnection;
import java.util.ArrayList;
import com.domain.LxrxxForm;
import com.tool.SQLCode;
import java.sql.ResultSet;
import java.sql.*;

public class LxrxxDaoImpl
    implements LxrxxDao {
  private JDBConnection connection = new JDBConnection();
// 全部信息查询
  public List select() {
    List list = new ArrayList();
    LxrxxForm form = null;
    String sql = SQLCode.getSQLCode("sql.lxrxx.select");
    try {
      ResultSet rs = connection.executeQuery(sql);
      while (rs.next()) {
        form = new LxrxxForm();
        form.setLxrxx_id(rs.getString(1));
        form.setLxrxx_qymc(rs.getString(2));
        form.setLxrxx_xm(rs.getString(3));
        form.setLxrxx_xb(rs.getString(4));
        form.setLxrxx_csny(rs.getString(5));
        form.setLxrxx_nl(rs.getString(6));
        form.setLxrxx_zw(rs.getString(7));
        form.setLxrxx_bgdh(rs.getString(8));
        form.setLxrxx_Email(rs.getString(9));
        form.setLxrxx_sj(rs.getString(10));
        form.setLxrxx_grjj(rs.getString(11));
        form.setLxrxx_djrq(rs.getString(12));
        form.setLxrxx_xxdjr(rs.getString(13));
        form.setLxrxx_bs(rs.getString(14));
        form.setLxrxx_bz(rs.getString(15));
        form.setId(Integer.valueOf(rs.getString(16)));
        list.add(form);
      }
    }
    catch (SQLException ex) {
    }
    return list;
  }

  public int countID() {
    int iCount = 0;
    String sql = SQLCode.getSQLCode("sql.lxrxx.countID");
    ResultSet rs = null;
    try {
      rs = connection.executeQuery(sql);
      while (rs.next()) {

        iCount = rs.getInt("t");
      }
    }
    catch (SQLException ex) {
    }
    connection.close();
    return iCount + 1;
  }

//插入操作
  public void insert(LxrxxForm form) {
    String sql = SQLCode.getSQLCode("sql.lxrxx.insert");
    System.out.println("sql=" + sql);
    sql = connection.editSqlCode(sql, form.getLxrxx_id());
    sql = connection.editSqlCode(sql, form.getLxrxx_qymc());
    sql = connection.editSqlCode(sql, form.getLxrxx_xm());
    sql = connection.editSqlCode(sql, form.getLxrxx_xb());
    sql = connection.editSqlCode(sql, form.getLxrxx_csny());
    sql = connection.editSqlCode(sql, form.getLxrxx_nl());
    sql = connection.editSqlCode(sql, form.getLxrxx_zw());
    sql = connection.editSqlCode(sql, form.getLxrxx_bgdh());
    sql = connection.editSqlCode(sql, form.getLxrxx_Email());
    sql = connection.editSqlCode(sql, form.getLxrxx_sj());
    sql = connection.editSqlCode(sql, form.getLxrxx_grjj());
    sql = connection.editSqlCode(sql, form.getLxrxx_djrq());
    sql = connection.editSqlCode(sql, form.getLxrxx_xxdjr());
    sql = connection.editSqlCode(sql, form.getLxrxx_bs());
    sql = connection.editSqlCode(sql, form.getLxrxx_bz());
    connection.executeUpdate(sql);
    connection.close();
  }

  //删除操作
  public void delete(LxrxxForm form) {
    String sql = SQLCode.getSQLCode("sql.lxrxx.delete");
    sql = connection.editSqlCode(sql, form.getId());
    connection.executeUpdate(sql);
    connection.close();
  }

//单独查询操作
  public LxrxxForm selectOne(LxrxxForm form) {
    LxrxxForm lxrxxForm = null;
    String sql = SQLCode.getSQLCode("sql.lxrxx.selectOne");
    sql = connection.editSqlCode(sql, form.getId());
    try {
      ResultSet rs = connection.executeQuery(sql);
      while (rs.next()) {
        lxrxxForm = new LxrxxForm();
        lxrxxForm.setLxrxx_id(rs.getString(1));
        lxrxxForm.setLxrxx_qymc(rs.getString(2));
        lxrxxForm.setLxrxx_xm(rs.getString(3));
        lxrxxForm.setLxrxx_xb(rs.getString(4));
        lxrxxForm.setLxrxx_csny(rs.getString(5));
        lxrxxForm.setLxrxx_nl(rs.getString(6));
        lxrxxForm.setLxrxx_zw(rs.getString(7));
        lxrxxForm.setLxrxx_bgdh(rs.getString(8));
        lxrxxForm.setLxrxx_Email(rs.getString(9));
        lxrxxForm.setLxrxx_sj(rs.getString(10));
        lxrxxForm.setLxrxx_grjj(rs.getString(11));
        lxrxxForm.setLxrxx_djrq(rs.getString(12));
        lxrxxForm.setLxrxx_xxdjr(rs.getString(13));
        lxrxxForm.setLxrxx_bs(rs.getString(14));
        lxrxxForm.setLxrxx_bz(rs.getString(15));
        lxrxxForm.setId(Integer.valueOf(rs.getString(16)));
      }
    }
    catch (SQLException ex) {
    }
    return form;
  }
}

⌨️ 快捷键说明

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