HP Integrity NonStop J-Series User Manual
Page 114
![background image](/manuals/397993/114/background.png)
jdbc-0.proxool.alias=property
jdbc-0.proxool.driver-url=jdbc:t4sqlmx://
jdbc-0.proxool.driver-class=com.tandem.t4jdbc.SQLMXDriver
jdbc-0.user=
jdbc-0.password=
jdbc-0.proxool.maximum-connection-count=15
jdbc-0.proxool.minimum-connection-count=5
For a list of Proxool properties, see
Using JNDI datasource with C3P0 connection pooling
Steps to use JNDI datasource with C3P0 connection pooling are as follows:
1.
Define a bean for datasource in the applicationContext.xml file. For example:
For T2 driver:
For T4 driver:
2.
Register this bean as a JNDI datasource by writing a few lines of code as follows. The context
referred here is a Spring application context.
Hashtable
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:///home/dataSources");
Object datasource=context.getBean("T2bean"); // for T4 you can use T4Bean
try {
Context ctx = new InitialContext(env);
ctx.rebind("jndi",datasource );
}
catch (Exception e) {
}
3.
Use this JNDI datasource in a Spring Hibernate application. The applicationContext.xml
can be configured as follows:
Now this jndiDataSource can be set on hibernate session factory as follows:
114
Hibernate Framework