1.sqlserver2000 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <!-- Hibernate SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="mappingResources"> <list> <value>com/oy/image/model/LoginUser.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.connection.release_mode">auto</prop> <prop key="hibernate.autoReconnect">true</prop> </props> </property> </bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value> </property> <property name="jdbcUrl"> <value>jdbc:microsoft:sqlserver://localhost:1433;databaseName=users</value> </property> <property name="user"> <value>bruce</value> </property> <property name="password"> <value>bruce</value> </property> <!--连接池中保留的最小连接数。--> <property name="minPoolSize"> <value>5</value> </property> <!--连接池中保留的最大连接数。Default: 15 --> <property name="maxPoolSize"> <value>30</value> </property> <!--初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 --> <property name="initialPoolSize"> <value>10</value> </property> <!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 --> <property name="maxIdleTime"> <value>60</value> </property> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 --> <property name="acquireIncrement"> <value>5</value> </property> <!--JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。 如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0--> <property name="maxStatements"> <value>0</value> </property> <!--每60秒检查所有连接池中的空闲连接。Default: 0 --> <property name="idleConnectionTestPeriod"> <value>60</value> </property> <!--定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 --> <property name="acquireRetryAttempts"> <value>30</value> </property> <!--获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效 保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试 获取连接失败后该数据源将申明已断开并永久关闭。Default: false--> <property name="breakAfterAcquireFailure"> <value>true</value> </property> <!--因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的 时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable 等方法来提升连接测试的性能。Default: false --> <property name="testConnectionOnCheckout"> <value>false</value> </property> </bean> <bean id="imageDao" name="imageDao" class="com.oy.image.dao.hibernate.ImageDaoHibernate" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="imageManager" name="imageManager" class="com.oy.image.service.impl.ImageManagerImpl" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="imageDao"> <ref bean="imageDao" /> </property> </bean> </beans> 2.mysql <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>com.mysql.jdbc.Driver</value> </property> <property name="jdbcUrl"> <value> jdbc:mysql://192.168.0.1:3306/DBName?useUnicode=true&characterEncoding=UTF-8 </value> </property> <property name="user"> <value>root</value> </property> <property name="password"> <value>root</value> </property> <!-- 连接池中保留的最小连接数. --> <property name="minPoolSize"> <value>5</value> </property> <!-- 连接池中保留的最大连接数。Default: 15 --> <property name="maxPoolSize"> <value>30</value> </property> <!-- 初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 --> <property name="initialPoolSize"> <value>10</value> </property> <!-- 最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 --> <property name="maxIdleTime"> <value>60</value> </property> <!-- 当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 --> <property name="acquireIncrement"> <value>5</value> </property> <!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。 如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 --> <property name="maxStatements"> <value>0</value> </property> <!-- 每60秒检查所有连接池中的空闲连接。Default: 0 --> <property name="idleConnectionTestPeriod"> <value>60</value> </property> <!-- 定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 --> <property name="acquireRetryAttempts"> <value>30</value> </property> <!-- 获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效 保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试 获取连接失败后该数据源将申明已断开并永久关闭。Default: false--> <property name="breakAfterAcquireFailure"> <value>true</value> </property> <!-- 因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的 时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable 等方法来提升连接测试的性能。Default: false --> <property name="testConnectionOnCheckout"> <value>false</value> </property> </bean> <!-- Hibernate SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="mappingResources"> <list> <value>com/oy/image/model/LoginUser.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.connection.release_mode"> auto </prop> <prop key="hibernate.autoReconnect">true</prop> </props> </property> </bean> <bean id="imageDao" name="imageDao" class="com.oy.image.dao.hibernate.ImageDaoHibernate" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="imageManager" name="imageManager" class="com.oy.image.service.impl.ImageManagerImpl" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="imageDao"> <ref bean="imageDao" /> </property> </bean> </beans> 3.oracle <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="driverClass"> <value>oracle.jdbc.driver.OracleDriver</value> </property> <property name="jdbcUrl"> <value>jdbc:oracle:thin:@192.168.0.1:1521:orcl</value> </property> <property name="user"> <value>username</value> </property> <property name="password"> <value>password</value> </property> <property name="minPoolSize"> <value>10</value> </property> <property name="maxPoolSize"> <value>20</value> </property> <property name="initialPoolSize"> <value>10</value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"></ref> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.OracleDialect </prop> <prop key="hibernate.show_sql"> false </prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.cache.use_query_cache"> true </prop> <prop key="hibernate.cache.use_second_level_cache"> true </prop> <prop key="hibernate.cache.provider_class"> net.sf.ehcache.hibernate.EhCacheProvider </prop> <prop key="hibernate.connection.provider_class"> org.hibernate.connection.C3P0ConnectionProvider </prop> <prop key="hibernate.query.substitutions"> true 1, false 0, yes 'Y', no 'N' </prop> <prop key="hibernate.bytecode.use_reflection_optimizer"> true </prop> <prop key="hibernate.use_outer_join">true</prop> <prop key="hibernate.prepare_sql">true</prop> <prop key="hibernate.query.factory_class"> org.hibernate.hql.ast.ASTQueryTranslatorFactory </prop> </props> </property> <property name="mappingResources"> <list> <value>xxx/xx/xx.hbm.xml</value> <value>xxx/xx/xx.hbm.xml</value> </list> </property> </bean> <bean id="imageDao" name="imageDao" class="com.oy.image.dao.hibernate.ImageDaoHibernate" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="imageManager" name="imageManager" class="com.oy.image.service.impl.ImageManagerImpl" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="imageDao"> <ref bean="imageDao" /> </property> </bean> </beans>
相关推荐
包括SSH框架搭建,数据库连接池,JSP内置对象等技术的总结文本文档打包,解压后可观看。
【毕业设计】SSH框架实战项目...Struts2+Spring+Hibernate+MySQL5.x+proxool数据库连接池 (3)主要功能: 用户:注册,登录,修改密码,注销 商品:添加新商品,查看在拍商品,出价 出价记录:提交出价记录,成交
自己手动搭建的一个ssh框架,对于初学者有很好的帮助!数据库oracle,c3p0连接池……
学生会信息管理系统(管理员与注册用户)SSH框架 mysql数据库 管理员:用户管理、人员管理、活动管理、报名信息管理、密码修改 注册用户:资料修改、活动信息查看并报名、报名结果查看、密码修改 项目中数据...
ssh框架 hibernate 对MySQL数据库连接池 jar包
在Java中整合SSH(Spring + Struts2 + ...数据库连接池: 例如com.springsource.org.apache.commons.dbcp-x.x.x.osgi。 日志和测试相关的jar包: 如log4j, junit等。 整合用的jar包: 用于整合Spring和Struts2的
连接池是proxool,log4j日志,拦截器过滤器什么的都有。 基本上每个地方以及每个配置文件,每行,都有相关的说明。全是自己研究的。 proxool里面没有注释是因为程序解析的时候出错所以没写,这个网上大把。 顺便...
java web开发 建数据库连接池 ssh 框架开发……
包含所有的ssh框架所需要的jar包文件,mysql 的链接驱动,还有c3p0连接池java发送邮件的jar包集合
充分运用SSH技术,是学习的好工具,分页、数据库连接池等等都运用了。
Srping+SpringMVC+hibernate搭建,其中包含了详细的配置文件的功能注释,例如:声明式事务管理的两种实现方式(注解式与配置式),还有不同连接池的配置(apache.dbcp/alibaba.druid.pool),不同数据库连接(Oracle/...
1、proxool官网,下载最新的proxool-...3、创建自定义数据库连接池监听 4、整合Struts2、Spring和proxool,配置Web服务启动配置文件[web.xml] 5、整合Spring和proxool,配置应用上下文配置文件[applicationContext.xml]
最新版SSH框架(spring3.1.2+hibernate4.1.4+struts2.3.4+bonecp0.7.1) 使用bonecp作为数据库连接池工具 下载后可以运行,有例子,使用freemarker模板展示。
给刚开始接触SSH框架的人使用,基本的SSH Jar包,数据库驱动,数据库连接池
系统控制器、业务层、数据层采用spring注解方式,hibernate事务注入,c3p0数据库连接池等。又实现了权限拦截器、项目监听器、单元测试等功能。 页面简洁大气美观,系统耦合度小,可配置度高,几乎包含了全部常用...
由Struts2+spring4+hibernate4搭建而成的SSH框架,spring的配置采用了注解的方式。连接池用了c3p0,数据库是MySQL。
本系统要实现企业在日常办公时所需要的基本功能,并采用MVC三层架构开发模式,...数据库连接池的统一管理,如果程序需要连接,则从此池中取出一个连接使用,使用完后又返回给该池,这些连接可以互用,从而提高的效率。
1.使用MyEclipse提供的数据库连接工具,连接上数据库;... dataSource(数据库连接池) sessionFactory 5.测试spring和hibernate的结合; 6.自动生成po和dao; 7.把生成的底层迁移到eclipse 8.在底层中加入分页功能;
学习javaweb开发时收集的常用jar,下载一下,可以在学习过程中减少找jar包的时间,大概包含了SSM,SSH框架的所有jar包,数据库连接池和驱动也有,测试jar包也有
本文件为SSH开发框架,版本为struts2.3+spring4.2+hibernate5.4,采用druid数据库连接池,logback日志系统,jackson包实现ajax