Hibernate C3P0 properties.

These are following Hibernate JDBC properties:
  1. hibernate.connection.driver_class: This property is used for JDBC driver class.
  2. hibernate.connection.url: It denotes the JDBC url.
  3. hibernate.connection.username: It denotes the database username.
  4. hibernate.connection.password: It denotes the database user password.
  5. hibernate.c3p0.min_size: This is used to fix the pool minimum size.
  6. hibernate.c3p0.max_size: This is used to fix the pool maximum size.
  7. hibernate.c3p0.timeout: This show the connection timeout.
Here we can see the example in hibernate.cfg.xml. as

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration><session-factory><property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property><property name="hibernate.connection.url">jdbc:mysql://localhost:3306/javaforecast</property><property name="hibernate.connection.username">javaforecast</property><property name="hibernate.connection.password">jfc4u</property><property name="hibernate.c3p0.min_size">10</property><property name="hibernate.c3p0.maz_size">20</property><property name="hibernate.c3p0.timout">50</property></session-factory></hibernate-configuration>





0 comments :

Post a Comment