20:43:06

package com.chinasofti.dao;

import java.util.List;

import com.chinasofti.entity.User;

public interface user_dao {
//登录
public boolean dl(User user);
//注册
public boolean zc(User user);
//查看用户
public List<User> userShow();
//删除用户
public void userdelete(int id);
//修改用一 先找到用户
public User toupadte(int id);
//修改用二 修改用户
public void upadte(User user);
//添加
public void adduser(User user); }

20:43:54

package com.chinasofti.dao.impl;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import org.apache.catalina.Session;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import com.chinasofti.dao.user_dao;
import com.chinasofti.entity.User; @Repository(value="dao")
public class user_daoimpl implements user_dao{ @Autowired
private SqlSessionFactory sessionFactory;
/**
* 登录
*/
@Override
public boolean dl(User user) {
boolean flag=false;
SqlSession session = sessionFactory.openSession();
String select="com.chinasofti.mapper.userMapper.showuser";
Object i = session.selectOne(select, user);
if (i!=null) {
return flag=true;
}else {
return flag;
}
}
/**
* 注册
*/
@Override
public boolean zc(User user) {
boolean flag=false;
SqlSession session = sessionFactory.openSession();
String select="com.chinasofti.mapper.userMapper.showuser";
Object i = session.selectOne(select, user);
if (i!=null) {
return flag;
}else {
String add="com.chinasofti.mapper.userMapper.zcuser";
int insert = session.insert(add, user);
return flag=true;
}
}
/**
*查看用户
*/
@Override
public List<User> userShow() {
SqlSession session = sessionFactory.openSession();
String select="com.chinasofti.mapper.userMapper.usershow";
List<User> userlist=session.selectList(select);
return userlist; }
/**
* 删除用户
*/
@Override
public void userdelete(int id) {
SqlSession session = sessionFactory.openSession();
String deleteuser="com.chinasofti.mapper.userMapper.deleteuser";
int delete = session.delete(deleteuser, id);
}
/**
* 修改用户
*/
//先找到用户
@Override
public User toupadte(int id) {
SqlSession session = sessionFactory.openSession();
System.out.println(id+">>>>>>>>>>>>>>>");
User user= session.selectOne("com.chinasofti.mapper.userMapper.selectuser", id);
System.out.println(user.toString());
return user;
}
@Override
public void upadte(User user) {
SqlSession session = sessionFactory.openSession();
String update="com.chinasofti.mapper.userMapper.updateUser";
session.update(update, user);
}
/**
*添加用户
*/
@Override
public void adduser(User user) {
SqlSession session = sessionFactory.openSession();
String insert="com.chinasofti.mapper.userMapper.adduser";
session.insert(insert, user);
} }

20:44:19

package com.chinasofti.entity;

public class User {
private Integer u_id;
private String u_name;
private String u_password;
public Integer getU_id() {
return u_id;
}
public void setU_id(Integer u_id) {
this.u_id = u_id;
}
public String getU_name() {
return u_name;
}
public void setU_name(String u_name) {
this.u_name = u_name;
}
public String getU_password() {
return u_password;
}
public void setU_password(String u_password) {
this.u_password = u_password;
}
@Override
public String toString() {
return "User [u_id=" + u_id + ", u_name=" + u_name + ", u_password=" + u_password + "]";
}
public User(String u_name, String u_password) {
super();
this.u_name = u_name;
this.u_password = u_password;
}
public User() {
super();
}
public User(Integer u_id, String u_name, String u_password) {
super();
this.u_id = u_id;
this.u_name = u_name;
this.u_password = u_password;
} }

20:44:34

package com.chinasofti.handler;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import com.chinasofti.entity.User;
import com.chinasofti.service.user_service; @Controller
public class handler {
private static final String SUCCESS="success";
boolean flag=false; @Autowired
HttpServletRequest request; List<User> userlist=null; @Resource(name="service")
private user_service service; /**
* 登录
*/
@RequestMapping(value="/dl")
public String dl(User user) {
flag=service.dl(user);
if (flag==true) {
return SUCCESS;
}else{
return "redirect:/login.jsp";
}
} /**
* 注册
*/
@RequestMapping(value="/zc")
public String zc(User user) {
flag=service.zc(user);
if (flag==true) {
return "redirect:/login.jsp";
}else{
return "redirect:/zc.jsp";
}
} /**
* 查看用户
*/
@RequestMapping(value="/ck")
public String userlist() {
userlist=service.userShow();
request.getSession().setAttribute("userlist", userlist);
return "userShow";
} /**
* 删除用户
*/
@RequestMapping(value="/del", method = RequestMethod.GET)
public String userdelete(@RequestParam("id") int id) {
service.userdelete(id);
return SUCCESS;
}
/**
* 修改用户 先找到用户
*/
@RequestMapping(value="/toupdate", method = RequestMethod.GET)
public String toupdateuser(@RequestParam("id") int id) {
System.out.println(id);
User user=service.toupadte(id);
System.out.println(user);
request.getSession().setAttribute("userupdatelist", user);
return "update";
}
@RequestMapping(value="/update")
public String updateuser(User user) {
service.upadte(user);
return SUCCESS;
}
/**
* 添加用户
*/
@RequestMapping(value="/add")
public String add() {
return "add";
}
@RequestMapping(value="/adduser")
public String adduser(User user) {
service.adduser(user);
return SUCCESS;
} }

20:44:51

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chinasofti.mapper.userMapper"> <!-- 登录 -->
<select id="showuser" resultType="int" parameterType="com.chinasofti.entity.User">
select *
from users where u_name=#{u_name} and
u_password=#{u_password}
</select> <!-- 注册 -->
<insert id="zcuser" parameterType="com.chinasofti.entity.User">
insert into users
values(null,#{u_name},#{u_password})
</insert> <!-- 查看 -->
<select id="usershow" resultType="com.chinasofti.entity.User">
select * from users
</select> <!-- 根据id查询删除一个user -->
<delete id="deleteuser" parameterType="com.chinasofti.entity.User">
delete from users where u_id=#{id}
</delete> <!-- 添加user -->
<insert id="adduser" parameterType="com.chinasofti.entity.User">
insert into users
values(null,#{u_name},#{u_password})
</insert> <!-- 修改user -->
<!-- 查看 -->
<select id="selectuser" resultType="com.chinasofti.entity.User">
select * from users where u_id=#{u_id}
</select> <update id="updateUser" parameterType="com.chinasofti.entity.User">
update users set u_name=#{u_name},u_password=#{u_password} where u_id=#{u_id}
</update> </mapper>

20:45:13

package com.chinasofti.service;

import java.util.List;

import com.chinasofti.entity.User;

public interface user_service {
//登录
boolean dl(User user);
//注册
boolean zc(User user);
//查看用户
public List<User> userShow();
//删除用户
public void userdelete(int id);
//修改用户 先找到
public User toupadte(int id);
//修改用户
public void upadte(User user);
//添加
public void adduser(User user);
}

20:45:32

package com.chinasofti.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import com.chinasofti.dao.user_dao;
import com.chinasofti.entity.User;
import com.chinasofti.service.user_service; @Service(value="service")
public class user_serviceimpl implements user_service {
@Resource(name="dao")
private user_dao userdao;
//登录
@Override
public boolean dl(User user) {
return userdao.dl(user);
}
//注册
@Override
public boolean zc(User user) {
return userdao.zc(user);
}
//查看用户
@Override
public List<User> userShow() {
return userdao.userShow();
}
//删除用户
@Override
public void userdelete(int id) {
userdao.userdelete(id);
}
//修改用户 先找到
@Override
public User toupadte(int id) {
return userdao.toupadte(id);
}
@Override
public void upadte(User user) {
userdao.upadte(user);
}
@Override
public void adduser(User user) {
userdao.adduser(user);
} }

20:45:48

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- 开启扫描 -->
<context:component-scan base-package="com"></context:component-scan>
<!-- 启动aop支持 -->
<aop:aspectj-autoproxy />
<!-- 引入数据源 -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:datasource.properties</value>
</property>
</bean>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driver}"></property>
<property name="url" value="${jdbc.url}"></property>
<property name="username" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
</bean>
<!-- 配置session工厂 -->
<bean id="sqlsessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="configLocation" value="classpath:mybatis.config.xml"></property>
</bean>
<!-- 配置事物管理器 -->
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>

20:46:12

jdbc.driver=com.mysql.jdbc.Driver

jdbc.url=jdbc:mysql:///ssm?useUnicode=true&characterEncoding=UTF-8

jdbc.username=root

jdbc.password=root

20:47:43

### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=info, stdout

20:47:57

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<mappers>
<mapper resource="com/chinasofti/mapper/userMapper.xml"/>
</mappers>
</configuration>

20:48:16

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- 配置扫描 -->
<context:component-scan base-package="com"></context:component-scan> <!-- 配置静态资源不过滤 -->
<mvc:default-servlet-handler />
<!-- 在实际开发中都需要配置 mvc:annotation-driven 标签 -->
<mvc:annotation-driven/> <!-- 配置前缀和后缀 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!-- 配置上传 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="utf-8"></property>
<property name="maxUploadSize" value="1024000"></property>
</bean>
</beans>

20:48:31

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="adduser" method="post">
<input type="text" name="u_name">
<input type="text" name="u_password">
<input type="submit" value="添加">
</form>
</body>
</html>

20:49:22

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" isErrorPage="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
你登录成功了小伙儿
<br>
<br>
<a href="ck">查看用户</a>
</body>
</html>

20:49:49

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="update" method="post">
<input type="text" name="u_id" value="${userupdatelist.u_id }" readonly="readonly">
<input type="text" name="u_name" value="${userupdatelist.u_name }">
<input type="text" name="u_password" value="${userupdatelist.u_password }">
<input type="submit" value="确认修改">
</form>
</body>
</html>

20:50:04

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<table border="1" bordercolor="red">
<tr>
<td>编号</td>
<td>账户</td>
<td>密码</td>
<td>删除</td>
<td>修改</td>
</tr>
<c:forEach items="${userlist}" var="l">
<tr>
<td>${l.u_id}</td>
<td>${l.u_name}</td>
<td>${l.u_password}</td>
<td ><a href="del?id=${l.u_id}">删除</a></td>
<td><a href="toupdate?id=${l.u_id}">修改</a></td>
</tr>
</c:forEach>
</table>
<a href="add">添加用户</a> </body>
</html>

20:50:16

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Struts2Hibernate5Spring4</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- The front controller of this Spring Web application, responsible for
handling all application requests --> <!-- spring-mvc -->
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- spring -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml
</param-value>
</context-param>
<!-- -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
</web-app>

20:50:39

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" isErrorPage="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<a href="login.jsp">登录</a><br>
<a href="zc.jsp">注册</a>
</body>
</html>

20:50:55

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="dl">
<input type="text" name="u_name"><br> <input type="password" name="u_password"><br><br>
<input type="submit" value="登录">
</form>
</body>
</html>

20:51:06

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="update">
用户名<input readonly="readonly" name="u_name"><br>
修改密码<input type="text" name="u_password"><br><br>
<input type="submit" value="确认修改">
</form>
</body>
</html>

20:51:21

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="zc">
用户名<input type="text" name="u_name"><br>
密码<input type="password" name="u_password"><br><br>
<input type="submit" value="注册">
</form>
</body>
</html>

2017-09-07  20:51:38

【SSM】---增删改查的更多相关文章

  1. SSM增删改查

    闲着无聊配置一遍SSM以及添加功能增删改查,如下图,其中坎坷也挺多!!! 1.工程如下图.(请忽略红叉,没有错误) 2.首先配置pom.xml文件. <project xmlns="h ...

  2. 基于SSM之Mybatis接口实现增删改查(CRUD)功能

    国庆已过,要安心的学习了. SSM框架以前做过基本的了解,相比于ssh它更为优秀. 现基于JAVA应用程序用Mybatis接口简单的实现CRUD功能: 基本结构: (PS:其实这个就是用的Mapper ...

  3. SSM框架搭建(Spring+SpringMVC+MyBatis)与easyui集成并实现增删改查实现

    一.用myEclipse初始化Web项目 新建一个web project: 二.创建包 controller        //控制类 service //服务接口 service.impl //服务 ...

  4. ssm学习(四)--完整的增删改查demo

    上一篇文章简要介绍了将sping mvc加入整个框架,算是完成了ssm的集成.本节继续前面的内容,结合spring mvc做一个简单的增删改查demo. 1.首先,重写一下GeckoList.jsp页 ...

  5. 搭建ssm框架,可实现登录和数据展示以及增删改查

    需求: 后台使用ssm(spring-springMVC-mybatis)进行整合 前台使用bootstrap框架 前后台交互使用Ajax进行发送 表结构: 登录页面后显示所有用户信息,可对每条进行增 ...

  6. SpringMVC之简单的增删改查示例(SSM整合)

    本篇文章主要介绍了SpringMVC之简单的增删改查示例(SSM整合),这个例子是基于SpringMVC+Spring+Mybatis实现的.有兴趣的可以了解一下. 虽然已经在做关于SpringMVC ...

  7. bootstrap+Ajax+SSM(maven搭建)实现增删改查

    https://www.jianshu.com/p/d76316b48e3e 源码: https://github.com/Ching-Lee/crud 功能点: 分页 数据校验 ajax Rest风 ...

  8. 增删改查的SSM小项目

      经过将近一个月的摸索,终于算是勉强完成了关于增删改查的SSM项目. github源码地址:https://github.com/123456abcdefg/Login 好了,话不多说,写一下具体代 ...

  9. IDEA搭建SSM实现登录、注册,数据增删改查功能

     本博文的源代码:百度云盘/java/java实例/SSM实例/SSM实现登录注册,增删改查/IDEA搭建SSM实现登录,注册,增删改查功能.zip 搭建空的Maven项目 使用Intellij id ...

  10. 【项目笔记】完成一个基于SSM框架的增删改查的模块后总结的问题

    最近为了准备新工作重新摸出了SSM框架,同时从0学习了JQuery,终于用一周做完了一个包括增删改查的模块(主要是属性太多了,其中一个类50+,复制粘贴耗时). 从中特意记下了几个遇到的问题,总结一下 ...

随机推荐

  1. 【bzoj 4059】Non-boring sequences

    这题的重点不在于代码,而在于复杂度分析…… 首先我们肯定会写 $n^2$ 暴力,就是每次暴力扫 $[l,r]$ 区间,找到任意一个在此区间中只出现过一次的数.设其下标为 $mid$,显然在这个区间中任 ...

  2. Summer training round2 #3

    A!:                    GTY系列题 B!:莫队加分块  GTY系列题 C!:线段树模拟拓扑排序(把普通的拓扑排序的栈操作改成线段树区间减一,查询区间最右侧的0的位置即可.注意一 ...

  3. win redis安装

    一.下载windows版本的Redis 去官网找了很久,发现原来在官网上可以下载的windows版本的,现在官网以及没有下载地址,只能在github上下载,官网只提供linux版本的下载 官网下载地址 ...

  4. jdbc 占位符插入null值 NullPointerException

    如果变量flag 为空 ,那么executeUpdate 后面的参数 bookCollect.getFlag() 就会被executeUpdate()方法忽略掉,程序会报错. String addSq ...

  5. P1801 黑匣子[对顶堆]

    没错我就是专门找对顶堆练习题的.现在感觉对顶堆使用面有点狭窄.这道题由于我询问是随时间单调增的,而且数据比较友好,应该是插入几次就询问一下的.而中位数那题也是经常询问的.如果查询的东西不单调,或者查询 ...

  6. Druid连接池错误(数据库版本问题)

    前提 jdbc驱动: mysql-connector-java.8.0.13.jar durid依赖包:durid-1.0.9.jar mysql版本: mysql 8.0 1 错误 1.1 错误一 ...

  7. JPA的常用Annotation

    http://www.blogjava.net/zJun/archive/2007/01/24/95747.html @transient 忽略该方法 一. @Entity:通过@Entity注解将一 ...

  8. Lettuce连接池——解决“MXBean already registered with name org.apache.commons.pool2:type=GenericObjectPool,name=pool”

    LettuceConfig: package com.youdao.outfox.interflow.config; import io.lettuce.core.support.Connection ...

  9. 在HTML中引入CSS的方式

    有 4 种方式可以在 HTML 中引入 CSS.其中有 2 种方式是在 HTML 文件中直接添加 CSS 代码,另外两种是引入 外部 CSS 文件.   ㈠内联方式 内联方式指的是直接在 HTML 标 ...

  10. luogu 5311 [Ynoi2011]D1T3 动态点分治+树状数组

    我这份代码已经奇怪到一定程度了~ 洛谷上一直 $TLE$,但是本地造了几个数据都过了. 简单说一下题解: 先建出来点分树. 对于每一个询问,在点分树中尽可能向上跳祖先,看是否能够处理这个询问. 找到最 ...