Introduction to Jdbc With Postgresql, Mysql, and Oracle in Java

Below are the summary of connection settings for differenct jdbc provider:

Database Connection Url Driver Class Hibernate Dialect Cache Provider Class
PostgreSQL jdbc:postgresql://[host]:[port]/[db] org.postgresql.Driver org.hibernate.dialect.PostgreSQLDialect
MySQL jdbc:mysql://[host]:[port]/[db] com.mysql.jdbc.Driver org.hibernate.dialect.MySQLDialect
Oracle jdbc:oracle:thin:@[host]:[port]:[db] oracle.jdbc.OracleDriver org.hibernate.dialect.OracleDialect
HSQL DB jdbc:hsqldb:mem:core org.hsqldb.jdbcDriver org.hibernate.cache.NoCacheProvider / org.hibernate.cache.HashtableCacheProvider
Oracle XE jdbc:oracle:thin:@localhost:1521:XE oracle.jdbc.driver.OracleDriver org.hibernate.cache.NoCacheProvider / org.hibernate.cache.HashtableCacheProvider

*Note in Oracle driver class and hibernate dialect are not required.

1 Comments

  1. I think as long as you have connection to the database when you start your app, the dialect can be detected by hibernate.

    ReplyDelete

Post a Comment

Post a Comment

Previous Post Next Post
NERV Open Source
Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.