MultipleDatabases |
|
Your trail: |
Difference between
version 3
and
version 1:
At line 1 added 1 line. |
!!Multiple Databases |
At line 3 added 1 line. |
* Is there an easy way in Appfuse to switch between various databases? |
At line 3 changed 6 lines. |
We use many different dbs in both test and production.. To achieve this easily we have 1 properties file for each db driver/type. Then in the properties.xml file: |
<!-- DB properties setup --> |
<property name="db.driver" value="mysql"/> |
<property file="${db.driver}.properties"/> |
<propertycopy name="database.jar.path" from="${database.type}.jar" silent="true"/> |
<property name="database.jar" location="${database.jar.path}"/> |
If you use many different Databases, you can point AppFuse to the various instances by |
having 1 properties file for each db driver/type. Then in the properties.xml file: |
At line 10 changed 1 line. |
so we can do builds with -Ddb.driver=mysql or -Ddb.driver=db2.typeII and the builds will load mysql.properties or db2.typeII.properties as the database configuration file. |
{{{ |
<property name="db.driver" value="mysql"/> |
<property file="${db.driver}.properties"/> |
<propertycopy name="database.jar.path" from="${database.type}.jar" silent="true"/> |
<property name="database.jar" location="${database.jar.path}"/> |
}}} |
|
So you can do builds with -Ddb.driver=mysql or -Ddb.driver=db2.typeII and the builds will load mysql.properties or db2.typeII.properties as the database configuration file. |
|
Great tip from Matthew Fleming! |
Back to MultipleDatabases,
or to the Page History.
|