07 2022 档案

摘要:try{ dao.inser(entity); } catch (Exception e){ if(e instanceof DuplicateKeyException){ return -2; }else { return -1; } 在service层中 public MessageModel 阅读全文
posted @ 2022-07-29 08:58 lwx_R 阅读(1033) 评论(0) 推荐(0) 编辑
摘要:JDBC Type Java Type CHAR String VARCHAR String LONGVARCHAR String NUMERIC java.math.BigDecimal DECIMAL java.math.BigDecimal BIT boolean BOOLEAN boolea 阅读全文
posted @ 2022-07-29 08:53 lwx_R 阅读(39) 评论(0) 推荐(0) 编辑
摘要:1.第一种写法 Mapper接口函数 public boolean uploadUserUpwd(String upwd,String uname); Mapper.xml <update id="uploadUserUpwd" parameterType="String" > update log 阅读全文
posted @ 2022-07-21 11:20 lwx_R 阅读(106) 评论(0) 推荐(0) 编辑
摘要:Mapper.xml <insert id="AddNewCar" parameterType="com.xxx.entity.Car" useGeneratedKeys="true" keyProperty="cid"> insert into car(brand,model,price,time 阅读全文
posted @ 2022-07-21 11:07 lwx_R 阅读(360) 评论(0) 推荐(0) 编辑
摘要:1.在要上传的本地文件夹右键选择Git Bash 2.输入 git init,会在本地文件生成.git文件,该文件是隐藏的 3.输入 git remote add origin https://gitee.com/wpsunbo/used-car-trading-platform.git origi 阅读全文
posted @ 2022-07-16 17:15 lwx_R 阅读(162) 评论(0) 推荐(0) 编辑
摘要:1.实现方式:JDK动态代理和CGLIB动态代理 2.动态代理特点 1.目标对象不固定 2.在应用程序执行时动态创建目标对象 3.代理对象会增强目标对象的行为 3.JDK动态代理 package com.xxx.proxy; import java.lang.reflect.InvocationHa 阅读全文
posted @ 2022-07-15 19:27 lwx_R 阅读(25) 评论(0) 推荐(0) 编辑
摘要:<!-- JSTL实现包 --> <dependency> <groupId>org.apache.taglibs</groupId> <artifactId>taglibs-standard-impl</artifactId> <version>1.2.5</version> </dependen 阅读全文
posted @ 2022-07-15 09:39 lwx_R 阅读(257) 评论(0) 推荐(0) 编辑
摘要:1.EL表达式不生效 ${data}直接在界面显示,没有变成data的值 解决方法:在jsp页面头添加如下内容,来关闭忽略el表达式 <%@ page isELIgnored="false" %> 阅读全文
posted @ 2022-07-15 09:38 lwx_R 阅读(20) 评论(0) 推荐(0) 编辑
摘要:1.代理三要素 1.共同行为-定义接口 2.真实角色-实现接口 3.代理角色-实现接口 增强用户行为 2.静态代理特点 1.目标角色固定 2.在应用程序之前就知道目标角色 3.代理对象增强目标对象行为 4.有可能有多个代理,产生类爆炸 package com.xxx.proxy; /** * 静态代 阅读全文
posted @ 2022-07-14 22:59 lwx_R 阅读(54) 评论(0) 推荐(0) 编辑
摘要:1.代理模式介绍 为某一个对象(委托类)提供一个代理,用来控制对这个对象的访问。 委托类和代理类有共同的父类/父类接口 代理类会对请求做预处理,过滤,将请求分配给指定对象 2.代理模式原则 1.代理类和委托类有共同行为 2.代理类可以增强委托人行为 3.常见代理模式:静态代理,动态代理 阅读全文
posted @ 2022-07-14 18:18 lwx_R 阅读(21) 评论(0) 推荐(0) 编辑
摘要:1. Error querying database. Cause: java.sql.SQLException: No suitable driver found for http://www.example.com 原因:分析编译后的文件,发现配置文件的url被改成http://www.exam 阅读全文
posted @ 2022-07-07 22:46 lwx_R 阅读(46) 评论(0) 推荐(0) 编辑
摘要:1.mysql-connector-java-8.0.28 地址:https://downloads.mysql.com/archives/c-j/ 选择Plantform independent 2.mybatis-3.5.2 地址:http://www.mybatis.cn/82.html 3. 阅读全文
posted @ 2022-07-07 22:21 lwx_R 阅读(198) 评论(0) 推荐(0) 编辑
摘要:spring.xml <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSch 阅读全文
posted @ 2022-07-07 09:54 lwx_R 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1.手动注入方法:set注入,构造器注入,静态工厂注入,实例化工厂注入 1.1 set注入 在类中需要别的bean/基本数据类型,需要设置对应的set方法 实例化A时需要B注入,先实例化A,再把B实例化 public class UserService { //bean类型注入 private da 阅读全文
posted @ 2022-07-04 11:52 lwx_R 阅读(38) 评论(0) 推荐(0) 编辑
摘要:![](https://img2022.cnblogs.com/blog/2211217/202207/2211217-20220704095123092-1229996196.png) 阅读全文
posted @ 2022-07-04 09:52 lwx_R 阅读(6) 评论(0) 推荐(0) 编辑
摘要:/** * IOC容器Bean对象实例化方法 * 1、构造器实例化:Bean对象需要空构造 * 2、静态工厂实例化 * 3、实例化工厂实例化 */ public void fun(){ BeanFactory factory= new ClassPathXmlApplicationContext(" 阅读全文
posted @ 2022-07-03 10:45 lwx_R 阅读(29) 评论(0) 推荐(0) 编辑
摘要:public void fun0(){ //Spring配置文件加载:得到Spring上下文环境 //单个配置文件 ApplicationContext ac=new ClassPathXmlApplicationContext("spring.xml"); //多配置文件 1.可变参数 传入多个文 阅读全文
posted @ 2022-07-03 10:44 lwx_R 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1.新建web项目 2.修改pom.xml 从mvn中找spring依赖 <!-- 添加Spring依赖--> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <g 阅读全文
posted @ 2022-07-02 11:33 lwx_R 阅读(42) 评论(0) 推荐(0) 编辑
摘要:1.Spring介绍 Spring框架是开源的javaEE的应用程序 主要核心 ioc(控制反转/依赖注入) 和aop(面向切面编程) 2.Spring作用 Dao层: JDBC Mybatis Service层: Controller层: Servlet SpringMVC 3.Spring容器机 阅读全文
posted @ 2022-07-02 10:57 lwx_R 阅读(22) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示