I need to be able to save database configuration properties in src|main|java|dbConnection.properties
and include it in jstlhibernate.cfg.xml
expressions . (for example: $ {password}, etc.). How to do it?
Current hibernate.cfg.xml:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.username">postgres</property>
<property name="connection.password">postgres</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
</session-factory>
</hibernate-configuration>
I need something like this:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">${DRIVER}</property>
<property name="connection.username">${USERNAME}</property>
<property name="connection.password">${PASSWORD}</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
</session-factory>
</hibernate-configuration>
source
share