ページの先頭行へ戻る
Interstage Business Application Server 12.0.0 オープンJavaフレームワークユーザーズガイド Java EE 7編
FUJITSU Software

3.6.3 データソースの登録

Interstage Java EE 7のasadminコマンドでJDBC接続プールおよびJDBCリソースを作成します。作成したJDBCリソースをデータソースとして利用します。

asadminコマンドのcreate-jdbc-connection-poolサブコマンドおよびcreate-jdbc-resourceサブコマンドを使用して、アプリケーションで使用するJNDI名のJDBCリソースを作成してください。

詳細は“Interstage Application Server Java EE 7設計・構築・運用ガイド”を参照してください。

下記にコマンド実行例を示します。太字部分はシステムにあわせて設定してください。

Symfoware Server (Postgres) を使用する場合

$ /opt/FJSVisje7/glassfish/bin/asadmin create-jdbc-connection-pool \
  --datasourceclassname org.postgresql.ds.PGPoolingDataSource \
  --restype javax.sql.DataSource \
  --property user=user001:password=abcd1234:databaseName=DB001:serverName=server01:portNumber=26500 \
  spring43_pool
$ /opt/FJSVisje7/glassfish/bin/asadmin create-jdbc-resource \
  --target IJServer001 \
  --connectionpoolid spring43_pool \
  jdbc/spring43AppDataSource

Oracle Databaseを使用する場合

$ /opt/FJSVisje7/glassfish/bin/asadmin create-jdbc-connection-pool \
  --datasourceclassname oracle.jdbc.pool.OracleConnectionPoolDataSource \
  --restype javax.sql.ConnectionPoolDataSource \
  --property user=user001:password=abcd1234:URL=jdbc\:oracle\:thin\:@//server01\:1521/orcl \
  spring43_pool
$ /opt/FJSVisje7/glassfish/bin/asadmin create-jdbc-resource \
  --target IJServer001 \
  --connectionpoolid spring43_pool \
  jdbc/spring43AppDataSource