Configuring Custom database in Hybris

By default,Hybris uses HSQL DB and it’s been configured in the file inside platform folder.

If we open the file inside platform folder we can find the below details

  1. #HSQL DB configuration
  2. db.url=jdbc:hsqldb:file:${HYBRIS_DATA_DIR}/hsqldb/mydb;shutdown=true;hsqldb.cache_rows=100000;hsqldb.cache_size=20000;hsqldb.write_delay_millis=1000;hsqldb.inc_backup=true;hsqldb.defrag_limit=2;hsqldb.nio_data_file=false
  3. db.driver=org.hsqldb.jdbcDriver
  4. db.username=sa
  5. db.password=
  6. db.tableprefix=
#HSQL DB configuration

These properties provide the configuration details required for connecting HSQL DB.

We can add MYSQL,Oracle or SQLServer DB configuration details to configure the corresponding DB using the same keys but with respective values.

MYSQL DB configuration should have below details

  1. db.url=jdbc:mysql://localhost/<dbname>?useConfigs=maxPerformance&characterEncoding=utf8
  2. db.driver=com.mysql.jdbc.Driver
  3. db.username=<username>
  4. db.password=<password>
  5. db.tableprefix=

Oracle DB configuration should have below details

  1. db.url=jdbc:oracle:thin:@<host>:1521:<sid>
  2. db.driver=oracle.jdbc.driver.OracleDriver
  3. db.username=<username>
  4. db.password=<password>
  5. db.tableprefix=

We need to specify the details like DB name,driver name and credentials for the same keys accordingly.

Where do we need to define the MYSQL/Oracle DB configuration?

In platform’s file itself?
Absolutely not,We know that in Hybris we should not touch any of the existing extensions including platform extension.

But this file is available in platform extension then where to add the MYSQL/Oracle DB details? file
Yes we should add the MYSQL/Oracle DB configuration details in the file available inside config folder

Since we are going to use the same keys with different values, the highest precedence always goes to file first and hence MYSQL DB will be connected rather than HSQL DB.
For more details on the properties file and their precedence, please read this article.

If we don’t define any DB related configuration inside local.porperties file then HSQL DB configuration inside platform’s file will be considered and HSQL DB will be connected.


Make sure that whatever the Database we configure with Hybris should be connected in the system.
So install and configure the DB in the system before accessing it from Hybris.

About the Author

Founder of
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to

Connect with me on Facebook for more updates

Share this article on