Put your Postgres JDBC driver in the deployment folder (just expand). Now use the CLI console and enter the following command:
data-source add --name=PostgresqlDS --jndi-name=java:jboss/datasources/PostgresqlDS --driver-name=postgresql-9.4-1201.jdbc41.jar --connection-url=jdbc:postgresql://localhost:5432/test --user-name=USER --password=PASSWORD
Check if your driver is jdbc4.
I don't know why, but adding data sources using the web console does not work. By CLI it works.
The correct solution for extending JDBC drivers is to add a driver as a module for the server. In WildFly 9, you can do this using the cli console. You cannot do this by copying the JDBC JAR file (with xml) into the "module" folder, as in WildFly 8 .
Run the commands:
module add --name=org.postgres --resources=postgresql-9.4-1201.jdbc41.jar --dependencies=javax.api,javax.transaction.api /subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
To view the built-in drivers, type:
/subsystem=datasources:installed-drivers-list
With drivers creating data sources, it will be easy.
Please use the 9.0 final version. There are errors in CR.
Regards, Pawel M
Dentka Pawel M
source share