Friday, September 25, 2020

HIBERNATE CFG.XML File For POSTGRES


<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE hibernate-configuration SYSTEM 

"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>


<property name="hibernate.dialect"> org.hibernate.dialect.PostgreSQLDialect</property>


<property name="hibernate.connection.driver_class"> org.postgresql.Driver</property>


<!-- Assume test is the database name -->

<property name="hibernate.connection.url">jdbc:mysql://localhost:5432/test </property>

<property name="hibernate.connection.username">postgres</property>

<property name="hibernate.connection.password">admin </property>

<!-- Drop and re-create the database schema on startup -->

<property name="hbm2ddl.auto">create</property>

<property name="show_sql">true</property>

<!-- List of XML mapping files -->

<mapping class="com.manoj.hibernate.User" />

</session-factory>

</hibernate-configuration>

No comments:

Post a Comment

Guitar Chords

click on   Guitar Chords Family