LoginSignup
1
3

More than 5 years have passed since last update.

WildFly 10のCLIでxa-data-source追加

Last updated at Posted at 2017-06-09

WildFly 10のCLIでXAデータソースを追加するためのコマンド。バージョンによって微妙にコマンドが異なるようで、若干苦戦したのでメモを残す。

環境

  • WildFly 10.1.0.Final
  • Oracle Database 11g Release 2(11.2.0.1.0) Enterprise Edition
  • PostgreSQL 9.5.6

手順など

[standalone@localhost:9990 /] jdbc-driver-info
NAME       SOURCE
h2         com.h2database.h2/main
oracle     com.oracle/main
postgresql org.postgresql/main
[standalone@localhost:9990 /] xa-data-source add \
>   --name=XAOracleDS \
>   --driver-name=oracle \
>   --jndi-name=java:/XAOracleDS \
>   --user-name=kagamihoge \
>   --password=xxxx \
>   --xa-datasource-properties=URL=jdbc:oracle:thin:@//192.168.0.20:1521/ORCL.kagamihoge
[standalone@localhost:9990 /] xa-data-source test-connection-in-pool --name=XAOracleDS
true
[standalone@localhost:9990 /] xa-data-source add \
>   --name=PostgresXADS \
>   --driver-name=postgresql \
>   --jndi-name=java:/PostgresXADS \
>   --user-name=postgres \
>   --password=postgres \
>   --xa-datasource-properties=DatabaseName=postgres,PortNumber=5432,ServerName=192.168.0.21
[standalone@localhost:9990 /] xa-data-source test-connection-in-pool --name=PostgresXADS2
true
xa-data-source add \
  --name= \
  --driver-name= \
  --jndi-name= \
  --user-name= \
  --password= \
  --xa-datasource-properties=

xa-data-source add --helpでパラメータ一覧などが確認できる。--xa-datasource-propertiesはDBMSによって異なると思われる。バージョンによってはここをbatコマンドで入力するようだが、10ではこのパラメータでまとめて指定できるようだ。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3