WebRoot/WEB-INF/classes/resource/beans_sql2000.xml

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?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:context="http://www.springframework.org/schema/context"
       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/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
	<!--这个配置项会扫描这个包下的类 它子包下面的类也会被扫描到 需要在类前面加上注解@Service 就会交给Spring容器来处理了-->
	<context:component-scan base-package="com"/>
		<tx:annotation-driven transaction-manager="transactionManager"/>
		<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
			<property name="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
			<property name="url" value="jdbc:microsoft:sqlserver://localhost:1433;databaseName=study"/>
			<property name="username" value="sa"/>
			<property name="password" value="sa"/>
			<property name="initialSize" value="1"/>
			<property name="maxActive" value="500"/>
			<property name="maxIdle" value="2"/>
			<property name="minIdle" value="1"/>
		</bean>
		
		<bean id="lobHandler" lazy-init="true"   class="org.springframework.jdbc.support.lob.DefaultLobHandler">
       	 	
       </bean>
		
		<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
			<property name="dataSource" ref="dataSource"/>
			<property name="lobHandler" ref="lobHandler"/>
			<property name="mappingResources">
				<list>
					<!-- 系统配置  START-->
					<value>com/sys/admin/entity/SysAdmin.hbm.xml</value>
					<value>com/sys/admin/entity/FileEntity.hbm.xml</value>
					<!-- 系统配置  END-->
					
				</list>
			</property>
			<property name="hibernateProperties">
				<value>
					hibernate.dialect=org.hibernate.dialect.SQLServerDialect
					hibernate.show_sql=true
					hibernate.hbm2ddl.auto=update
					hibernate.format_sql=false
					<!--  openSessionInView 需要加的属性
					hibernate.current_session_context_class=thread
					-->
				</value>
			</property>
		</bean>
		
		<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
			<property name="sessionFactory" ref="sessionFactory"/>
		</bean>
		<tx:annotation-driven transaction-manager="txManager"/>
		<!-- 持久层DAO -->
后面还有 7 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。