热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

010_学生管理系统一

源码:https:download.csdn.netdownloadaihiao149745201.新建一个名为StudentManager的Web项目2.考入相关jar3.c3p

源码: https://download.csdn.net/download/aihiao/14974520

 

1. 新建一个名为StudentManager的Web项目

2. 考入相关jar

3. c3p0-config.xml配置


com.mysql.cj.jdbc.Driverjdbc:mysql://192.168.25.138:3306/StudentManager?useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghairootlyw123456103010010200

4. 数据库连接池JDBCUtil.java工具类

package com.lywgames.util;import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;/*** 使用数据库连接池的获取的数据库连接, 我们不用做关闭操作, 数据库连接池自行管理*/
public class JDBCUtil {private static DataSource dataSource = null;static {dataSource = new ComboPooledDataSource();}public static DataSource getDataSource() {return dataSource;}/*** 获取连接对象*/public static Connection getConn(){try {return dataSource.getConnection();} catch (SQLException e) {e.printStackTrace();}return null;}/*** 释放资源* @param st* @param rs*/public static void release(Statement st, ResultSet rs){closeRs(rs);closeSt(st);}public static void release(Statement st){closeSt(st);}public static void closeRs(ResultSet rs){try {if(rs != null){rs.close();}} catch (SQLException e) {e.printStackTrace();}finally{rs = null;}}public static void closeSt(Statement st){try {if(st != null){st.close();}} catch (SQLException e) {e.printStackTrace();}finally{st = null;}}}

5. 学生Student.java实体类

package com.lywgames.domain;import java.sql.Timestamp;/*** 这是学封装的对象 bean*/
public class Student {private int sid;private String sname;private String gender;private String phone;private String hobby;private String info;private Timestamp birthday;public Student() {}public Student(String sname, String gender, String phone, String hobby, String info, Timestamp birthday) {this.sname = sname;this.gender = gender;this.phone = phone;this.hobby = hobby;this.info = info;this.birthday = birthday;}public Student(int sid, String sname, String gender, String phone, String hobby, String info, Timestamp birthday) {super();this.sid = sid;this.sname = sname;this.gender = gender;this.phone = phone;this.hobby = hobby;this.info = info;this.birthday = birthday;}public int getSid() {return sid;}public void setSid(int sid) {this.sid = sid;}public String getSname() {return sname;}public void setSname(String sname) {this.sname = sname;}public String getGender() {return gender;}public void setGender(String gender) {this.gender = gender;}public String getPhone() {return phone;}public void setPhone(String phone) {this.phone = phone;}public String getHobby() {return hobby;}public void setHobby(String hobby) {this.hobby = hobby;}public String getInfo() {return info;}public void setInfo(String info) {this.info = info;}public Timestamp getBirthday() {return birthday;}public void setBirthday(Timestamp birthday) {this.birthday = birthday;}@Overridepublic String toString() {return "Student [sid=" + sid + ", sname=" + sname + ", gender=" + gender + ", phone=" + phone + ", hobby="+ hobby + ", info=" + info + ", birthday=" + birthday + "]";}}

6. 分页PageBean.java实体类

package com.lywgames.domain;import java.util.List;/*** 这是一个用于封装了分页的数据。* 里面包含:* 该页的学生集合数据* 总的记录数* 总的页数* 当前页* 每页显示的记录数* @param */
public class PageBean {private int currentPage; //当前页private int totalPage; //总页数private int pageSize; //每页的记录数private int totalSize; //总的记录数private List list; //当前页的学生集合public int getCurrentPage() {return currentPage;}public void setCurrentPage(int currentPage) {this.currentPage = currentPage;}public int getTotalPage() {return totalPage;}public void setTotalPage(int totalPage) {this.totalPage = totalPage;}public int getPageSize() {return pageSize;}public void setPageSize(int pageSize) {this.pageSize = pageSize;}public int getTotalSize() {return totalSize;}public void setTotalSize(int totalSize) {this.totalSize = totalSize;}public List getList() {return list;}public void setList(List list) {this.list = list;}
}

7. 数据库操作StudentDao.java接口

package com.lywgames.dao;import java.sql.SQLException;
import java.util.List;
import com.lywgames.domain.Student;/*** 这是针对学生表的数据访问 */
public interface StudentDao {/*** 查询所有学生* @return List*/List findAll() throws SQLException;/*** 添加学生* @param student 需要添加到数据库的学生对象* @throws SQLException*/int insert(Student student) throws SQLException;/*** 根据id删除学生* @param sid* @throws SQLException*/int delete(int sid) throws SQLException;/*** 根据id查询单个学生对象* @param sid* @return* @throws SQLException*/Student findStudentById(int sid) throws SQLException;/*** 更新学生信息* @param student 需要更新的学生数据* @throws SQLException*/int update(Student student) throws SQLException;/*** 模糊查询, 根据姓名或者根据性别或者两者兼有。 * @param sname* @param sgender* @return 集合* @throws SQLException*/List searchStudent(String sname, String sgender) throws SQLException;/*** 查询当页的学生数据* @param currentPage* @param pageSize* @return* @throws SQLException*/List findStudentByPage(int currentPage, int pageSize) throws SQLException;/*** 查询总的学生记录数* @return* @throws SQLException*/int findCount() throws SQLException;
}

8. 数据库操作StudentDaoImpl.java实现类

package com.lywgames.dao.impl;import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;
import com.lywgames.dao.StudentDao;
import com.lywgames.domain.Student;
import com.lywgames.util.JDBCUtil;/*** 这是StudentDao的实现。 针对前面定义的规范, 做出具体的实现。*/
public class StudentDaoImpl implements StudentDao {/*** 查询所有学生*/&#64;Overridepublic List findAll() throws SQLException {QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.query(JDBCUtil.getConn(), "select * from t_student", new BeanListHandler(Student.class));}/*** 添加学生*/&#64;Overridepublic int insert(Student student) throws SQLException {QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.update(JDBCUtil.getConn(), "insert into t_student values (null, ?, ?, ?, ?, ?, ?)", student.getSname(), student.getGender(), student.getPhone(), student.getHobby(), student.getInfo(), student.getBirthday());}/*** 根据id删除学生*/&#64;Overridepublic int delete(int sid) throws SQLException {QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.update(JDBCUtil.getConn(), "delete from t_student where sid &#61; ?", sid);}/*** 根据id查询单个学生对象*/&#64;Overridepublic Student findStudentById(int sid) throws SQLException {QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.query(JDBCUtil.getConn(), "select * from t_student where sid &#61; ?", new BeanHandler(Student.class), sid);}/*** 更新学生信息*/&#64;Overridepublic int update(Student student) throws SQLException {QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.update(JDBCUtil.getConn(), "update t_student set sname &#61; ?, gender &#61; ?, phone &#61; ?, hobby &#61; ?, info &#61; ?, birthday &#61; ? where sid &#61; ?", student.getSname(), student.getGender(), student.getPhone(), student.getHobby(), student.getInfo(), student.getBirthday(), student.getSid());}/*** 模糊查询, 根据姓名或者根据性别或者两者兼有。 */&#64;Overridepublic List searchStudent(String sname, String sgender) throws SQLException {/*** 1. sname有值, sgender为null或者""* select * from t_student where sname like ?* 2. sgender有值, sname为null或者""* select * from t_student where sgender &#61; ?* 3. sname有值, sgender也有值* select * from t_student where sname &#61; ? and sgender &#61; ?*/String sql &#61; "select * from t_student";List params &#61; new ArrayList();if(sname !&#61; null && sname.length() > 0 && (sgender &#61;&#61; null || sgender.length() <&#61; 0)) {sql &#61; sql &#43; " where sname like ?";params.add("%" &#43; sname &#43; "%");}if(sgender !&#61; null && sgender.length() > 0 && (sname &#61;&#61; null || sname.length() <&#61; 0)) {sql &#61; sql &#43; " where gender &#61; ?";params.add(sgender);}if(sname !&#61; null && sname.length() > 0 && sgender !&#61; null && sgender.length() > 0) {sql &#61; sql &#43; " where sname like ? and gender &#61; ?";params.add("%" &#43; sname &#43; "%");params.add(sgender);}QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.query(JDBCUtil.getConn(), sql, new BeanListHandler(Student.class), params.toArray());}/*** 查询当页的学生数据*/&#64;Overridepublic List findStudentByPage(int currentPage, int pageSize) throws SQLException {// 假设pageSize是5// 第一页: [5, 0], 0 &#61; (1 - 1) * 5// 第二页: [5, 5], 5 &#61; (2 - 1) * 5// 第三页: [5, 10], 10 &#61; (3 - 1) * 5String sql &#61; "select * from t_student limit ? offset ?";QueryRunner queryRunner &#61; new QueryRunner();return queryRunner.query(JDBCUtil.getConn(), sql, new BeanListHandler(Student.class), pageSize, (currentPage - 1) * pageSize);}/*** 查询总的学生记录数*/&#64;Overridepublic int findCount() throws SQLException {QueryRunner queryRunner &#61; new QueryRunner();return ((Long)queryRunner.query(JDBCUtil.getConn(), "select count(*) from t_student", new ScalarHandler())).intValue();}}

9. 逻辑操作StudentService.java接口

package com.lywgames.service;import java.sql.SQLException;
import java.util.List;
import com.lywgames.domain.PageBean;
import com.lywgames.domain.Student;/*** 这是学生的业务处理规范*/
public interface StudentService {int DEFAULT_PAGE_SIZE &#61; 5; // 默认一页显示多少条记录/*** 查询所有学生* &#64;return List*/List findAll();/*** 添加学生* &#64;param student 需要添加到数据库的学生对象* &#64;throws SQLException*/int insert(Student student);/*** 根据id删除学生* &#64;param sid* &#64;throws SQLException*/int delete(int sid);/*** 根据id查询单个学生对象* &#64;param sid* &#64;return* &#64;throws SQLException*/Student findStudentById(int sid);/*** 更新学生信息* &#64;param student 需要更新的学生数据* &#64;throws SQLException*/int update(Student student);/*** 模糊查询, 根据姓名或者根据性别或者两者兼有。 * &#64;param sname* &#64;param sgender* &#64;return 集合* &#64;throws SQLException*/List searchStudent(String sname, String sgender);/*** 查询当页的学生数据* &#64;param currentPage* &#64;return* &#64;throws SQLException*/PageBean findStudentByPage(int currentPage);
}

10. 逻辑操作StudentServiceImpl.java实现类

package com.lywgames.service.impl;import java.sql.SQLException;
import java.util.List;
import com.lywgames.dao.StudentDao;
import com.lywgames.dao.impl.StudentDaoImpl;
import com.lywgames.domain.PageBean;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;/*** 这是学生业务实现*/
public class StudentServiceImpl implements StudentService {private StudentDao studentDao &#61; new StudentDaoImpl();&#64;Overridepublic List findAll(){try {return studentDao.findAll();} catch (SQLException e) {e.printStackTrace();}return null;}&#64;Overridepublic int insert(Student student){try {return studentDao.insert(student);} catch (SQLException e) {e.printStackTrace();}return -1;}&#64;Overridepublic int delete(int sid) {try {return studentDao.delete(sid);} catch (SQLException e) {e.printStackTrace();}return -1;}&#64;Overridepublic Student findStudentById(int sid) {try {return studentDao.findStudentById(sid);} catch (SQLException e) {e.printStackTrace();}return null;}&#64;Overridepublic int update(Student student) {try {return studentDao.update(student);} catch (SQLException e) {e.printStackTrace();}return -1;}&#64;Overridepublic List searchStudent(String sname, String sgender) {try {return studentDao.searchStudent(sname, sgender);} catch (SQLException e) {e.printStackTrace();}return null;}&#64;Overridepublic PageBean findStudentByPage(int currentPage) {PageBean pageBean &#61; new PageBean();pageBean.setCurrentPage(currentPage);pageBean.setPageSize(DEFAULT_PAGE_SIZE);try {pageBean.setList(studentDao.findStudentByPage(currentPage, DEFAULT_PAGE_SIZE));int count &#61; studentDao.findCount();pageBean.setTotalSize(count);pageBean.setTotalPage(count % DEFAULT_PAGE_SIZE &#61;&#61; 0 ? count / DEFAULT_PAGE_SIZE : (count / DEFAULT_PAGE_SIZE) &#43; 1);} catch (SQLException e) {e.printStackTrace();}return pageBean;}}

11. 查找所有学生StudentListServlet.java

package com.lywgames.servlet;import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 查找所有学生*/
public class StudentListServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {StudentService service &#61; new StudentServiceImpl();List studentList &#61; service.findAll();if(studentList !&#61; null) {req.setAttribute("studentList", studentList);}req.getRequestDispatcher("list.jsp").forward(req, resp);}&#64;Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {doGet(req, resp);}
}

12. 分页查找学生StudentListPageServlet.java

package com.lywgames.servlet;import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.domain.PageBean;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 分页查找学生*/
public class StudentListPageServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {int currentPage &#61; Integer.valueOf(req.getParameter("currentPage")).intValue() ;StudentService service &#61; new StudentServiceImpl();PageBean pageBean &#61; service.findStudentByPage(currentPage);req.setAttribute("pageBean", pageBean);req.getRequestDispatcher("page_list.jsp").forward(req, resp);}&#64;Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {doGet(req, resp);}
}

13. 添加学生AddServlet.java

package com.lywgames.servlet;import java.io.IOException;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 添加学生*/
public class AddServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {req.setCharacterEncoding("utf-8");String sname &#61; req.getParameter("sname");String gender &#61; req.getParameter("gender");String phone &#61; req.getParameter("phone");String info &#61; req.getParameter("info");long time &#61; System.currentTimeMillis();try {time &#61; new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(req.getParameter("birthday")).getTime();} catch (ParseException e) {e.printStackTrace();}Timestamp birthday &#61; new Timestamp(time);String[] hobbys &#61; req.getParameterValues("hobby");StringBuffer sb &#61; new StringBuffer();for(int i &#61; 0; i }

14. 编辑学生信息EditServlet.java

package com.lywgames.servlet;import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 编辑学生信息*/
public class EditServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {req.setCharacterEncoding("utf-8");String sid &#61; req.getParameter("sid");StudentService service &#61; new StudentServiceImpl();Student student &#61; service.findStudentById(Integer.parseInt(sid));if(student !&#61; null) {req.setAttribute("student", student);req.getRequestDispatcher("edit.jsp").forward(req, resp);}}&#64;Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {doGet(req, resp);}
}

15. 更新学生信息UpdateServlet.java

package com.lywgames.servlet;import java.io.IOException;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 更新学生信息*/
public class UpdateServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {req.setCharacterEncoding("utf-8");int sid &#61; Integer.parseInt(req.getParameter("sid"));String sname &#61; req.getParameter("sname");String gender &#61; req.getParameter("gender");String phone &#61; req.getParameter("phone");String info &#61; req.getParameter("info");long time &#61; System.currentTimeMillis();try {time &#61; new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(req.getParameter("birthday")).getTime();} catch (ParseException e) {e.printStackTrace();}Timestamp birthday &#61; new Timestamp(time);String[] hobbys &#61; req.getParameterValues("hobby");StringBuffer sb &#61; new StringBuffer();for(int i &#61; 0; i }

16. 删除学生DeleteServlet.java

package com.lywgames.servlet;import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 删除学生*/
public class DeleteServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {req.setCharacterEncoding("utf-8");String sid &#61; req.getParameter("sid");StudentService service &#61; new StudentServiceImpl();int result &#61; service.delete(Integer.parseInt(sid));if(result &#61;&#61; 1) {req.getRequestDispatcher("StudentListServlet.action").forward(req, resp);}}&#64;Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {doGet(req, resp);}
}

17. 查找学生SearchStudentServlet.java

package com.lywgames.servlet;import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.lywgames.domain.Student;
import com.lywgames.service.StudentService;
import com.lywgames.service.impl.StudentServiceImpl;/*** 查找学生*/
public class SearchStudentServlet extends HttpServlet {private static final long serialVersionUID &#61; 1L;&#64;Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {req.setCharacterEncoding("utf-8");String sname &#61; req.getParameter("sname");String gender &#61; req.getParameter("gender");StudentService service &#61; new StudentServiceImpl();List studentList &#61; service.searchStudent(sname, gender);if(studentList !&#61; null) {req.setAttribute("studentList", studentList);}req.getRequestDispatcher("list.jsp").forward(req, resp);}&#64;Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {doGet(req, resp);}
}

18. web.xml配置


StudentManagerindex.htmlindex.htmindex.jspdefault.htmldefault.htmdefault.jspStudentListServletcom.lywgames.servlet.StudentListServletStudentListServlet/StudentListServlet.actionAddServletcom.lywgames.servlet.AddServletAddServlet/AddServlet.actionEditServletcom.lywgames.servlet.EditServletEditServlet/EditServlet.actionUpdateServletcom.lywgames.servlet.UpdateServletUpdateServlet/UpdateServlet.actionDeleteServletcom.lywgames.servlet.DeleteServletDeleteServlet/DeleteServlet.actionSearchStudentServletcom.lywgames.servlet.SearchStudentServletSearchStudentServlet/SearchStudentServlet.actionStudentListPageServletcom.lywgames.servlet.StudentListPageServletStudentListPageServlet/StudentListPageServlet.action

 


推荐阅读
  • r2dbc配置多数据源
    R2dbc配置多数据源问题根据官网配置r2dbc连接mysql多数据源所遇到的问题pom配置可以参考官网,不过我这样配置会报错我并没有这样配置将以下内容添加到pom.xml文件d ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • iOS超签签名服务器搭建及其优劣势
    本文介绍了搭建iOS超签签名服务器的原因和优势,包括不掉签、用户可以直接安装不需要信任、体验好等。同时也提到了超签的劣势,即一个证书只能安装100个,成本较高。文章还详细介绍了超签的实现原理,包括用户请求服务器安装mobileconfig文件、服务器调用苹果接口添加udid等步骤。最后,还提到了生成mobileconfig文件和导出AppleWorldwideDeveloperRelationsCertificationAuthority证书的方法。 ... [详细]
  • 在Kubernetes上部署JupyterHub的步骤和实验依赖
    本文介绍了在Kubernetes上部署JupyterHub的步骤和实验所需的依赖,包括安装Docker和K8s,使用kubeadm进行安装,以及更新下载的镜像等。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • eclipse学习(第三章:ssh中的Hibernate)——11.Hibernate的缓存(2级缓存,get和load)
    本文介绍了eclipse学习中的第三章内容,主要讲解了ssh中的Hibernate的缓存,包括2级缓存和get方法、load方法的区别。文章还涉及了项目实践和相关知识点的讲解。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 解决VS写C#项目导入MySQL数据源报错“You have a usable connection already”问题的正确方法
    本文介绍了在VS写C#项目导入MySQL数据源时出现报错“You have a usable connection already”的问题,并给出了正确的解决方法。详细描述了问题的出现情况和报错信息,并提供了解决该问题的步骤和注意事项。 ... [详细]
  • Android系统移植与调试之如何修改Android设备状态条上音量加减键在横竖屏切换的时候的显示于隐藏
    本文介绍了如何修改Android设备状态条上音量加减键在横竖屏切换时的显示与隐藏。通过修改系统文件system_bar.xml实现了该功能,并分享了解决思路和经验。 ... [详细]
  • MyBatis多表查询与动态SQL使用
    本文介绍了MyBatis多表查询与动态SQL的使用方法,包括一对一查询和一对多查询。同时还介绍了动态SQL的使用,包括if标签、trim标签、where标签、set标签和foreach标签的用法。文章还提供了相关的配置信息和示例代码。 ... [详细]
  • (三)多表代码生成的实现方法
    本文介绍了一种实现多表代码生成的方法,使用了java代码和org.jeecg框架中的相关类和接口。通过设置主表配置,可以生成父子表的数据模型。 ... [详细]
  • 从Oracle安全移植到国产达梦数据库的DBA实践与攻略
    随着我国对信息安全和自主可控技术的重视,国产数据库在党政机关、军队和大型央企等行业中得到了快速应用。本文介绍了如何降低从Oracle到国产达梦数据库的技术门槛,保障用户现有业务系统投资。具体包括分析待移植系统、确定移植对象、数据迁移、PL/SQL移植、校验移植结果以及应用系统的测试和优化等步骤。同时提供了移植攻略,包括待移植系统分析和准备移植环境的方法。通过本文的实践与攻略,DBA可以更好地完成Oracle安全移植到国产达梦数据库的工作。 ... [详细]
  • MySQL中的MVVC多版本并发控制机制的应用及实现
    本文介绍了MySQL中MVCC的应用及实现机制。MVCC是一种提高并发性能的技术,通过对事务内读取的内存进行处理,避免写操作堵塞读操作的并发问题。与其他数据库系统的MVCC实现机制不尽相同,MySQL的MVCC是在undolog中实现的。通过undolog可以找回数据的历史版本,提供给用户读取或在回滚时覆盖数据页上的数据。MySQL的大多数事务型存储引擎都实现了MVCC,但各自的实现机制有所不同。 ... [详细]
  • 本文介绍了如何使用PHP代码将表格导出为UTF8格式的Excel文件。首先,需要连接到数据库并获取表格的列名。然后,设置文件名和文件指针,并将内容写入文件。最后,设置响应头部,将文件作为附件下载。 ... [详细]
author-avatar
菜鸟自学编程
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有