shisgmei 发表于 2016-11-20 10:09:53

configure postgresql datasource in EAP 6.3 / Wildfly 8

find JBoss / Wildfly application server

./jboss-cli.sh

Install module containing the JDBC Driver. Specify the module name and the location where the jdbc driver has been downloaded:

module add --name=org.postgres --resources=/tmp/postgresql-9.3-1101.jdbc41.jar --dependencies=javax.api,javax.transaction.api

Now install the JDBC Driver on the application server:

/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)

Finally install the datasource which will connect to the default "postgres" database on localhost:

data-source add --jndi-name=java:/PostGreDS --name=PostgrePool --connection-url=jdbc:postgresql://localhost/postgres --driver-name=postgres --user-name=postgres --password=postgres


ref:

http://www.mastertheboss.com/jboss-server/jboss-datasource/configuring-a-datasource-with-postgresql-and-jboss-wildfly
页: [1]
查看完整版本: configure postgresql datasource in EAP 6.3 / Wildfly 8