CAS (12) —— CAS TicketRegistry使用JPA方案数据源c3p0与JNDI
CAS (12) —— CAS TicketRegistry使用JPA方案数据源c3p0与JNDI
tomcat版本: tomcat-8.0.29
jdk版本: jdk1.8.0_65
cas版本: 4.1.3
配置TicketRegistryDataSource
-
c3p0
<bean id="ticketDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" p:driverClass="com.mysql.jdbc.Driver" p:jdbcUrl="${database.connection.registry.jdbcUrl:jdbc:mysql://127.0.0.1:3306/hoau_cas_authen?autoReconnect=true}" p:user="${database.connection.registry.user:root}" p:password="${database.connection.registry.password:Root123}" p:initialPoolSize="${database.pool.minSize:6}" p:minPoolSize="${database.pool.minSize:6}" p:maxPoolSize="${database.pool.maxSize:18}" p:maxIdleTimeExcessConnections="${database.pool.maxIdleTime:1000}" p:checkoutTimeout="${database.pool.maxWait:2000}" p:acquireIncrement="${database.pool.acquireIncrement:16}" p:acquireRetryAttempts="${database.pool.acquireRetryAttempts:5}" p:acquireRetryDelay="${database.pool.acquireRetryDelay:2000}" p:idleConnectionTestPeriod="${database.pool.idleConnectionTestPeriod:30}" />
-
JNDI
<bean id="ticketDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:/nssods</value> </property> </bean>
参考
Jasig: 4.1.x JPA Ticket Registry
Jasig: 4.1.3 JPA Ticket Registry
Spring从JNDI得到DataSource与创建DataSource连接池
CAS (7) —— Mac下配置CAS 4.x集群及JPATicketRegistry