spring jdbc.xml 配置:
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
default-autowire="byName" default-lazy-init="false">
-----------------------------------------------------------------------------------------
数据源文件内容:
sqlServer.properties
.properties格式
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/数据库名
jdbc.username=mysql用户名
jdbc.password=mysql密码
配置这两个文件,在dao中
private SqlSession sqlSession;
get/set方法
在方法中 用 sqlSession就可以点出mybatis的方法 selectList、selectOne、、、
--------------------------------------------------------------------------------------------
mybatis xml配置文件:
还有2个总的配置文件,需要把spring和mybatis的xml文件引入
这几个文件配置好了就可以在
最简单的就写个jdbc
自己配个数据源啊,有数据源才能操作数据库啊