DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Providing Enum Consistency Between Application and Data
  • Projections/DTOs in Spring Data R2DBC
  • Private Remote Maven Repository With Artipie
  • How To Validate Names Using Java

Trending

  • Demystifying Project Loom: A Guide to Lightweight Threads in Java
  • Automated Testing Lifecycle
  • Unraveling Lombok's Code Design Pitfalls: Exploring Encapsulation Issues
  • Monkey-Patching in Java
  1. DZone
  2. Data Engineering
  3. Databases
  4. hibernate.cfg.xml Settings for Derby, Oracle and H2

hibernate.cfg.xml Settings for Derby, Oracle and H2

Peter Karussell user avatar by
Peter Karussell
·
Jun. 10, 09 · Interview
Like (0)
Save
Tweet
Share
100.89K Views

Join the DZone community and get the full member experience.

Join For Free

It took me some time to collect the hibernate.cfg.xml data which is necessary for Derby, Oracle and H2. So here are the default settings for those databases:

Apache Derby (network)

You start the network server and specify the following options in the script:

Linux: DERBY_OPTS=”-Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://localhost:1527/ -Dij.user=admin -Dij.password=admin”Windows: set DERBY_OPTS=”-Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://localhost:1527/ -Dij.user=admin -Dij.password=admin”
<property name=”hibernate.connection.driver_class”>org.apache.derby.jdbc.ClientDriver</property><property name=”hibernate.connection.url”>jdbc:derby://localhost:1527/databaseName;create=true</property><property name=”hibernate.connection.username”>admin</property><property name=”hibernate.connection.password”>admin</property><!– no schema necessary –><property name=”hibernate.dialect”>org.hibernate.dialect.DerbyDialect</property>

Oracle(Thin) 

<property name=”hibernate.connection.driver_class”>oracle.jdbc.driver.OracleDriver</property><property name=”hibernate.connection.url”>jdbc:oracle:thin:@host:1521:databaseName</property><property name=”hibernate.connection.username”>YOURSCHEMA</property><property name=”hibernate.connection.password”>YOURPASSWORD</property><property name=”hibernate.default_schema”>YOURSCHEMA</property><property name=”hibernate.dialect”>org.hibernate.dialect.OracleDialect</property>

H2

<property name=”hibernate.connection.driver_class”>org.h2.Driver</property><property name=”hibernate.connection.url”>jdbc:h2:path\databaseName</property><property name=”hibernate.connection.username”>sa</property><property name=”hibernate.connection.password”></property><property name=”hibernate.default_schema”>PUBLIC</property><property name=”hibernate.dialect”>org.hibernate.dialect.H2Dialect</property>

To make it complete here are the Maven settings for the databases:

Apache Derby (network)

<dependency><groupId>org.apache.derby</groupId><artifactId>derbyclient</artifactId><version>10.4.2.0</version></dependency>

Oracle (thin)

No public version is available but you could install the jar file into your local repository or into an archiva repository via:

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0.7.0 -Dpackaging=jar -Dfile=/path/to/file 
<dependency><groupId>com.oracle</groupId><artifactId>ojdbc6</artifactId><version>11.1.0.7.0</version></dependency>

H2

Apache Derby Database Repository (version control) Apache Maven Data (computing) JAR (file format) Network

Opinions expressed by DZone contributors are their own.

Related

  • Providing Enum Consistency Between Application and Data
  • Projections/DTOs in Spring Data R2DBC
  • Private Remote Maven Repository With Artipie
  • How To Validate Names Using Java

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: