web-4/backend/postgres-ds.cli

22 lines
744 B
Plaintext
Raw Normal View History

2024-12-24 01:21:02 +03:00
# Connect to the running server
connect
# Add PostgreSQL module
module add --name=org.postgres --resources=${user.home}/.m2/repository/org/postgresql/postgresql/42.6.0/postgresql-42.6.0.jar --dependencies=javax.api,javax.transaction.api
# Add the PostgreSQL driver
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
# Add the datasource
data-source add \
--jndi-name=java:/PostgresDS \
--name=PostgresDS \
--connection-url=jdbc:postgresql://localhost:5432/web-4 \
--driver-name=postgres \
--user-name=postgres \
--password=postgres \
--min-pool-size=5 \
--max-pool-size=15
# Reload the server configuration
reload