How to setup your datasource in Jboss7.x
Tech-Today

How to setup your datasource in Jboss7.x


Below are sample configurations you can use to setup postgresq, mysql data source in your jboss7.x.

Where to add:
1.) If you added Jboss Tools plugin to eclipse, in server view expand Jboss Server->Filesets->Configuration->standalone.xml

2.) Otherwise you can find standalone.xml in JBOSS_HOME/standalone/configuration.

<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="false" jndi-name="java:jboss/datasources/DropshipDataSource" pool-name="dropshipPool" enabled="true" use-java-context="true" use-ccm="false">
<connection-url>jdbc:postgresql://localhost:5432/dropship</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql</driver>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>user</user-name>
<password>user</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>1</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>10</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<datasource jta="false" jndi-name="java:jboss/datasources/MeveoAdminDatasource" pool-name="meveoDS" enabled="true" use-java-context="true" use-ccm="false">
<connection-url>jdbc:postgresql://localhost:5432/meveo</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql</driver>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>user</user-name>
<password>user</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>1</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>10</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<datasource jta="false" jndi-name="java:jboss/datasources/MeveoDWHDatasource" pool-name="meveoDWHDS" enabled="true" use-java-context="true" use-ccm="false">
<connection-url>jdbc:postgresql://localhost:5432/meveodwh</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql</driver>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>user</user-name>
<password>user</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>1</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>10</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>




- How To Use Mariadb And Liquibase Together With Maven On Jboss
First you must define the needed dependency in your pom file. <profile> <id>mariadb</id> <activation> <property> <name>env</name> <value>mariadb</value> </property> </activation> <properties>...

- How To Monitor The Data Source Connections And Sql Queries In Jboss
To allow us to debug our jboss server for possible connection leaks, wrong sql queries normally we do 2 changes: 1.) In persistence.xml, set hibernate.show_sql to true 2.) In jboss's standalone.xml, we set the hibernate logger to DEBUG <logger...

- How To Create A Modeshape Datasource Connection For Jboss
<datasource jndi-name="java:/jcr/myportal" pool-name="myJCRPortalPool" enabled="true" use-java-context="true"> <connection-url>jdbc:jcr:jndi:jcr?repositoryName=my</connection-url> <connection-property name="workspace"> extra </connection-property>...

- Jdbc Provider Setting In Java For Postgresql, Mysql And Oracle
Below are the summary of connection settings for differenct jdbc provider: Database Connection Url Driver Class Hibernate Dialect Cache Provider Class PostgreSQL jdbc:postgresql://[host]:[port]/[db] org.postgresql.Driver org.hibernate.dialect.PostgreSQLDialect...

- Things To Remember In Creating Jbpm With Seam
This writing will reference the TODO example from seam: http://docs.jboss.org/seam/latest/reference/en-US/html/tutorial.html#registration-example Note that I used seam-gen to generate the project. File you should have: +views +login.xhtml +todo.xhtml...



Tech-Today








.