sqllite
时间:2021-07-01 10:21:17
帮助过:1人阅读
- <?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:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
-
-
-
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
-
- <property name="driverClassName" value="org.sqlite.JDBC" />
-
- <property name="url" value="jdbc:sqlite:C:/Users/anialy/Desktop/workspace/MyProj/db/MY_DB" />
- </bean>
-
-
- <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
- <property name="dataSource">
- <ref local="dataSource" />
- </property>
- </bean>
-
-
- <bean id="appDao" class="com.anialy.myproj.dao.AppDao">
- <property name="jdbcTemplate">
- <ref local="jdbcTemplate" />
- </property>
- </bean>
-
- <bean id="versionDao" class="com.anialy.myproj.dao.VersionDao">
- <property name="jdbcTemplate">
- <ref local="jdbcTemplate" />
- </property>
- </bean>
-
- </beans>
在web.xml中添上
[html] view plain
copy
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener
- </listener-class>
- </listener>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>
- classpath:applicationContext-dao.xml
- </param-value>
- </context-param>
sqllite
标签: