Respect my work! or BTC: 1MTFbBSKrocPK7G6GKfG8RoTw5N57WnnNa ![]() If you have paid donate send me e-mail with Your data or transaction number to receive an access code to articles with limited access. |
PmWiki /
H2 database - several driversDownload
ProReports system uses the H2 database as an internal database. Due to the fact that the system uses an older version than the current one, when trying to access the user's H2 database, there may be a conflict between version of driver and database engine. Therefore, I have prepared driver version for the lastest version of H2 database. To access database with this driver, you need to prepare the datasource as JNDI. Note!
Datasource JDBC not work correct because in this case internal driver (older) for database H2 is used. JNDI definition to H2 database
<New id="prefixDB" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/prefixDB</Arg>
<Arg>
<New class="prorepo.org.h2.jdbcx.JdbcDataSource">
<Set name="URL">jdbc:h2:tcp://ADDRESSIP:9092/DATABASE</Set>
<Set name="LoginTimeout">10000</Set>
<Set name="user">USER</Set>
<Set name="password">PASSWORD</Set>
</New>
</Arg>
</New>
for example:
<New id="myh2DB" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/myh2DB</Arg>
<Arg>
<New class="prorepo.org.h2.jdbcx.JdbcDataSource">
<Set name="URL">jdbc:h2:tcp://192.168.10.20:9092/base</Set>
<Set name="LoginTimeout">10000</Set>
<Set name="user">sa</Set>
<Set name="password">sasa</Set>
</New>
</Arg>
</New>
<resource-ref>
<res-ref-name>jdbc/prefixDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
for example:
<resource-ref>
<res-ref-name>jdbc/myh2DB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
How prepare own file with driver for own version of H2 databaseNote!
This method can be used if you have to use several different versions of JDBC drivers.
rule org.h2.** prefix.org.h2.@1 for example: rule org.h2.** prorepo.org.h2.@1
java -jar jarjar-1.4.jar process jarjar.conf lib/<file h2*jar> lib/prefix<file h2*.jar> for example: java -jar jarjar-1.4.jar process jarjar.conf lib/h2-1.4.200.jar lib/prorepo.h2-1.4.200.jar
This page may have a more recent version on pmwiki.org: PmWiki:H2, and a talk page: PmWiki:H2-Talk. |