1.创建userinfo.sql数据库脚本 create table userinfo (id ), name ), password ), telephone ), isadmin )); --4.2 用户表序列 create sequence seq_userinfo; alter table userinfo add constraint pk_userinfo_id primary key(id); ','134518024 ','是'); commit; userinfo.sql 2.…
一.注解理论 使用注解来构造IoC容器 用注解来向Spring容器注册Bean.需要在applicationContext.xml中注册<context:component-scan base-package=”pagkage1[,pagkage2,…,pagkageN]”/>. 如:在base-package指明一个包 1 <context:component-scan base-package="cn.gacl.java"/> 表明cn.gacl.java包…
[参考文章]:SpringBoot之@EnableConfigurationProperties分析 [参考文章]:在Spring Boot中使用 @ConfigurationProperties 注解, @EnableConfigurationProperties 1. pom <!-- 通过资源文件注入属性配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifac…
1.创建如下项目结构 2.在src下的com.entity包下创建Dept.java package com.entity; /** * 部门表 * @author Holly老师 * */ public class Dept { private Integer deptno; //部门编号 private String dname; //部门名称 private String loc; //位置 public Dept() { } public Dept(Integer deptno, Str…
本文转自http://blog.csdn.net/zht666/article/details/38706083 Spring整合MyBatis使用到了mybatis-spring,在配置mybatis映射文件的时候,一般会使用MapperScannerConfigurer,MapperScannerConfigurer会自动扫描basePackage指定的包,找到映射接口类和映射XML文件,并进行注入.配置如下: <!-- 数据源 --> <bean id="dataSour…
1.根据日志分析,spring junit默认是自动回滚,不对数据库做任何的操作. 18:16:57.648 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Switching JDBC Connection [net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy@481d6644] to manual commit 18:16:57.649 [main] DEBUG o.s.t.c.t.Transaction…
一:基本步骤 新建Maven项目,导入相关依赖(推荐) 在WEB-INF的web.xml中进行配置 ————–Hibernate配置 —————- 创建entity包,创建数据库相关实体类 根据实体类创建**.hbm.xml映射文件(移动到resources/mapper下)或者直接使用hibernate注解 ——–Spring整合Hibernate配置 ———- 在resources下创建spring文件夹,新建spring-dao.xml,添加二者整合配置. ————Spring Servi…
最新版ssh hibernate spring struts2环境搭建 最新版spring Framework下载地址:spring4.0.0RELEASE环境搭建 http://repo.spring.io/release/org/springframework/spring/4.0.0.RELEASE/ 最新版hibernate下载地址:hibernate4.2.21 https://sourceforge.net/projects/hibernate/postdownload?source…
1.创建如下的oracle脚本 create table userinfo (id ), name ), password telephone ), isadmin )); --4.2 用户表序列 create sequence seq_userinfo; alter table userinfo add constraint pk_userinfo_id primary key(id); ','134518024 ','是'); commit; userinfo.sql 2.创建如下项目结构…
一. spring+struts2+ibatis 框架 搭建教程 参考:http://biancheng.dnbcw.net/linux/394565.html 二.分层 1.dao: 数据访问层(增删改查):一个接口,一个实现类,实现类需要继承 SqlMapClientDaoSupport 2.service:业务逻辑层:一个接口,一个实现类 ,在实现类添加dao的注入3.action: 表示层 需要继承 ActionSupport ,添加service的注入 4.model :实体类5.co…