Skip to content

Commit

Permalink
Added postgres driver to pom.xml and hibernate config file for postgr…
Browse files Browse the repository at this point in the history
…es (#74)

* added postgres driver to pom.xml and hibernate config file for postgres

* #PR 74 - fix the spacing

* PR #74 - fixed spacing

Co-authored-by: galilev <[email protected]>
Co-authored-by: Chayim <[email protected]>
  • Loading branch information
3 people authored Jun 26, 2022
1 parent cf3143d commit 6c0ce45
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<version>8.0.20</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.4.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
Expand Down
28 changes: 28 additions & 0 deletions src/test/resources/postgres_hibernate.cfg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<!-- JDBC Database connection settings -->
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/postgres/allowPublicKeyRetrieval=true&amp;useSSL=false</property>
<property name="connection.username">postgres</property>
<property name="connection.password">postgres</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<!-- JDBC connection pool settings ... using built-in test pool -->
<property name="connection.pool_size">1</property>
<!-- Echo the SQL to stdout -->
<property name="show_sql">false</property>
<!-- Set the current session context -->
<property name="current_session_context_class">thread</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- dbcp connection pool configuration -->
<property name="hibernate.dbcp.initialSize">5</property>
<property name="hibernate.dbcp.maxTotal">20</property>
<property name="hibernate.dbcp.maxIdle">10</property>
<property name="hibernate.dbcp.minIdle">5</property>
<property name="hibernate.dbcp.maxWaitMillis">-1</property>
</session-factory>
</hibernate-configuration>

0 comments on commit 6c0ce45

Please sign in to comment.