Skip to content

Instantly share code, notes, and snippets.

@ehsanullahjan
Last active May 4, 2016 14:35
Show Gist options
  • Save ehsanullahjan/0e193ce2f2c964f95cfc to your computer and use it in GitHub Desktop.
Save ehsanullahjan/0e193ce2f2c964f95cfc to your computer and use it in GitHub Desktop.
Templates for creating PostgreSQL, SQL Server, Oracle and MySQL datasources in JBoss / WildFly using JBoss CLI
# PostgreSQL
/subsystem=datasources/data-source={{data-source-name}}:add(jndi-name="{{jndi-name}}",driver-name="postgres",connection-url="{{jdbc-uri}}",user-name={{username}},password={{password}},enabled=true,use-java-context=true,background-validation=false,validate-on-match=true,valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker",exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter",min-pool-size=1,max-pool-size=10,idle-timeout-minutes=3)
# SQL Server
/subsystem=datasources/data-source={{data-source-name}}:add(jndi-name="{{jndi-name}}",driver-name="sqlserver",connection-url="{{jdbc-uri}}",user-name={{username}},password={{password}},enabled=true,use-java-context=true,background-validation=false,validate-on-match=true,valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker",min-pool-size=1,max-pool-size=10,idle-timeout-minutes=3)
# Oracle
/subsystem=datasources/data-source={{data-source-name}}:add(jndi-name="{{jndi-name}}",driver-name="oracle",connection-url="{{jdbc-uri}}",user-name={{username}},password={{password}},enabled=true,use-java-context=true,background-validation=false,validate-on-match=true,valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker",exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter",min-pool-size=1,max-pool-size=10,idle-timeout-minutes=3)
# MySQL
/subsystem=datasources/data-source={{datasource-name}}:add(jndi-name="{{jndi-name}}",driver-name="mysql",connection-url="{{jdbc-url}}",user-name={{username}},password={{password}},enabled=true,use-java-context=true,background-validation=false,validate-on-match=true,valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker",exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter",min-pool-size=1,max-pool-size=10,idle-timeout-minutes=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment