接続の確立
JDBC データソースの作成
Java アプリケーションから接続するJDBC データソースを作成できます。CData JDBC Driver for Informix に基づくJDBC データソースの作成は、3つの基本ステップで構成されます。
- ドライバーのJAR ファイルをクラスパスに追加します。JAR ファイルはインストールディレクトリの[lib]サブフォルダ内にあります。.lic ファイルはJAR ファイルと同じフォルダ内に配置される必要があることに注意してください。
- ドライバークラスを入力します。次に例を示します。
cdata.jdbc.informix.InformixDriver
- JDBC URL を入力します。次に例を示します。
jdbc:informix:Server=10.0.1.2;Port=50000;User=admin;Password=admin;Database=test or jdbc:cdata:informix:Server=10.0.1.2;Port=50000;User=admin;Password=admin;Database=test
上記の2つ目の形式は、同じURL 形式を使用しているドライバー間でアプリケーションに競合がある場合は、CData ドライバーを使用していることを確認するために常に使用できます。URL は "jdbc:informix:" または"jdbc:cdata:informix:" のいずれかから始まり、任意の接続プロパティの名前と値のペアをセミコロン区切りで入力します。
Connecting to Informix
Set the following properties to connect to Informix:- Server: Set this to the name of the server running Informix.
- Port: Set this to the port the Informix server is listening on.
- Database: Set this to the name of the Informix database.
- User: Set this to the username of a user allowed to access the database.
- Password: Set this to the password of a user allowed to access the database.