0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

jboss構築② JDBC設定(Db2)

Last updated at Posted at 2025-09-16

Db2のデータソースを設定する

※WASでは実績あるが、jbossは初めて

CUI(domainモードの場合)

connect

deployment deploy-file /tmp/db2jcc4.jar --server-groups=main-server-group --name=db2jcc4.jar

deployment list

data-source --profile=full add --name=Db2DS --jndi-name=java:jboss/Db2DS --enabled=true --driver-name=db2jcc4.jar --connection-url=jdbc:db2://192.168.2.215:50000/voicedown(データベース名) --user-name=db2inst1 --password=oaoaoa

data-source --profile=full query --name=Db2DS
※一覧が表示すること

※ドメインモードのコマンドでのテスト接続方法が不明。もう少し探してみる(笑)

GUI

※コマンドでの登録がうまくいかなかったので。

それでは手順を残す
##手順

1「Deployments」タブ

GUIで「Deployments」でドライバをドロップ&ドロップ
Db2の場合「db2jcc4.jar」

ドライバが登録されたことを確認する。

2 Configurationタブ

まずは「JDBC Driver」

Profile
あなたが適用したいプロファイル名(fullとか)
Datasources & Drivers
JDBC Driver
ADDする
Driver Name :「db2jcc4.jar」
Driver Module Name:「db2jcc4.jar」

3 Configurationタブ

次は「Datasources」

Datasources & Drivers
JDBC Driver
Driver Name:db2jcc4.jar
Driver Module Name:デフォルトで入ってたもの
Driver Class Name:デフォルトで入ってたもの

Connection URL:jdbc:db2://192.168.2.215:50000/xyz(データベース名)
User Name:接続ユーザ
Password:接続ユーザのパスワード

テスト接続 OK

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?