...
No Format | ||||
---|---|---|---|---|
| ||||
#Replace java.home with your jdk directory java.home=<java_home> #Replace jboss.home with the parent directory of lib/j2ee.jar jboss.home=<jboss_home>/server/<your_server_name> #Replace geronimo.home with the geronimo home directory. geronimo.home=<geronimo_home> #Fully qualified name of the JDBC driver class db.driver=com.mysql.jdbc.Driver #database url db.url=jdbc:mysql://localhost:3306/adi #database userId db.userid=root #database password db.password=password #script file for creating the tables sql.file=sql/db.sql #location of the jdbc driver jar. driver.classpath=<mysql-connector_home>/mysql-connector-java-3.1.1014-bin.jar #location of the hibernate jars. dependency.dir=<hibernate_home>/lib |
...
You need to copy the MySQL database driver into the Geronimo repository so that you can refer to it in the data source deployment plan. The Geronimo repository is located in the <geronimo_home>/repository directory. Inside this directory, create a new directory called mysql/jars and copy the mysql-connector-java-3.1.1014-bin.jar file into it.
Now, you need to define a data source deployment plan. For your convenience, the sample application already provides a deployment plan called mysql-geronimo-plan.xml located in the <brokerage_home>\plan directory. The following example shows the content of this deployment plan.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1"> <dep:moduleId> <dep:groupId>user</dep:groupId> <dep:artifactId>database-pool-HibernateDB</dep:artifactId> <dep:version>2.0</dep:version> <dep:type>car</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency <dep:groupId>mysql</dep:groupId> <dep:artifactId>mysql-connector-java</dep:artifactId> <dep:version>3.1.1014-bin</dep:version> <dep:type>jar</dep:type> </dep:dependency> </dep:dependencies> </dep:environment> <resourceadapter> <outbound-resourceadapter> <connection-definition> <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface> <connectiondefinition-instance> <name>HibernateDS</name> <config-property-setting name="Password">password</config-property-setting> <config-property-setting name="CommitBeforeAutocommit">false</config-property-setting> <config-property-setting name="Driver">com.mysql.jdbc.Driver</config-property-setting> <config-property-setting name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSorter</config-property-setting> <config-property-setting name="UserName">root</config-property-setting> <config-property-setting name="ConnectionURL">jdbc:mysql://localhost:3306/adi</config-property-setting> <connectionmanager> <local-transaction/> <single-pool> <max-size>10</max-size> <min-size>0</min-size> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds> <idle-timeout-minutes>30</idle-timeout-minutes> <match-one/> </single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> </outbound-resourceadapter> </resourceadapter> </connector> |
...