Hibernate JDBC 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.connection.pool_size: It show the maximum no of pooled connection.
Here we can see the example in hibernate.cfg.xml.

<?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/databasename</property>
<property name="hibernate.connection.username">usrname</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.pool_size">30</property>

</session-factory>
</hibernate-configuration>





0 comments :

Post a Comment