<datasources>
<local-tx-datasource>
<jndi-name>jijoDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jijo</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>mysql</password>
<!-- you can include connection properties that will get passed in
the DriverManager.getConnection(props) call-->
<!-- look at your Driver docs to see what these might be -->
<connection-property name="char.encoding">UTF-8</connection-property>
<transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
<!--pooling parameters-->
<min-pool-size>10</min-pool-size>
<max-pool-size>30</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>1</idle-timeout-minutes>
<!-- sql to call when connection is created -->
<new-connection-sql>select 1</new-connection-sql>
<!-- sql to call on an existing pooled connection when it is obtained from pool -->
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<set-tx-query-timeout></set-tx-query-timeout>
<query-timeout>300</query-timeout> <!-- maximum of 5 minutes for queries -->
</local-tx-datasource>
</datasources>
in your application WEB-INF/jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>java:/jaas/jmx-console</security-domain>
<resource-ref>
<res-ref-name>jijoDS</res-ref-name>
<jndi-name>java:/jijoDS</jndi-name>
</resource-ref>
</jboss-web>
in web.xml
<resource-ref>
<res-ref-name>jijoDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
in applicationContext.xml you are using Spring-Hibernate combination
<bean id="dataSource" class="org.springframework.
<property name="jndiName">
<value>java:/jijoDS</value>
</property>
</bean>
<bean id="hibernateProperties" class="org.springframework.
<property name="properties">
<props>
<prop key="hibernate.dialect">dialect name</prop>
<prop key="hibernate.show_sql">
<prop key="hibernate.cglib.use_
<prop key="hibernate.cache.provider_
<prop key="hibernate.transaction.
<prop key="hibernate.transaction.
<prop key="hibernate.connection.
</props>
</property>
</bean>
No comments:
Post a Comment