Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

JDBC provider setting in java for postgresql, mysql and oracle

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.
JDBC provider setting in java for postgresql, mysql and oracle JDBC provider setting in java for postgresql, mysql and oracle Reviewed by Edward Legaspi on Saturday, March 02, 2013 Rating: 5

1 comment:

Sebastien Michea said...

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

Powered by Blogger.