摘要: 1:@Autowired 优先getType,再getName 可以配合@Qualifier(value="***")使用。 2:@Resource 优先getName,再getType 可以通过@Resource(name="***")使用。 阅读全文
posted @ 2021-09-08 23:33 现在开始JAVA 阅读(32) 评论(0) 推荐(0)
摘要: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-in 阅读全文
posted @ 2021-09-08 23:06 现在开始JAVA 阅读(153) 评论(0) 推荐(0)
摘要: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-in 阅读全文
posted @ 2021-09-06 23:35 现在开始JAVA 阅读(216) 评论(0) 推荐(0)
摘要: 代码: 1 <sql id="if-title-author"> 2 <if test="title !=null"> 3 title=#{title} 4 </if> 5 <if test="author != null"> 6 and author=#{author} 7 </if> 8 </s 阅读全文
posted @ 2021-08-26 22:31 现在开始JAVA 阅读(118) 评论(0) 推荐(0)
摘要: 1:mybatis_config.xml 1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE configuration 3 PUBLIC "-//mybatis.org//DTD Config 3.0//EN" 4 "http://mybat 阅读全文
posted @ 2021-08-23 23:59 现在开始JAVA 阅读(35) 评论(0) 推荐(0)
摘要: 接口中: 1 int addUser2(Map<String,Object> map); View Code mapper.xml中: 1 <insert id="addUser2" parameterType="map"> 2 insert into mybatis.user (id, name, 阅读全文
posted @ 2021-08-19 21:35 现在开始JAVA 阅读(208) 评论(0) 推荐(0)
摘要: 在pom.xml文件中添加配置: 1 <!-- 在build中配置resources,来防止我们资源导出失败的问题--> 2 <build> 3 <resources> 4 <resource> 5 <directory>src/main/resources</directory> 6 <inclu 阅读全文
posted @ 2021-08-18 23:03 现在开始JAVA 阅读(34) 评论(0) 推荐(0)
摘要: 1 package com.kuang.test; 2 3 import org.junit.Test; 4 5 import java.sql.Connection; 6 import java.sql.DriverManager; 7 import java.sql.SQLException; 阅读全文
posted @ 2021-04-06 23:31 现在开始JAVA 阅读(37) 评论(0) 推荐(0)
摘要: 课程代码: 1 package com.kuang.test; 2 3 import java.sql.*; 4 5 public class TestJdbc { 6 public static void main(String[] args) throws ClassNotFoundExcept 阅读全文
posted @ 2021-04-06 22:49 现在开始JAVA 阅读(40) 评论(0) 推荐(0)
摘要: 课程代码: 1:实现监听接口: 1 public class OnlineCountListener implements HttpSessionListener { 2 3 public void sessionCreated(HttpSessionEvent se) { 4 ServletCon 阅读全文
posted @ 2021-03-25 22:57 现在开始JAVA 阅读(51) 评论(0) 推荐(0)