HomeMogDBMogDB StackUqbar
v2.1

Documentation:v2.1

Supported Versions:

Other Versions:

WebSphere Used for Configuring MogDB (PostgreSQL) Data Sources

Overview

WebSphere can be used for configuring MogDB data sources. So does it for configuring PostgreSQL data sources. For details, see the following sections.


Prerequisites

Confirmation of the WebSphere JDK Version

C:\Windows\system32>D:\IBM1\WebSphere\AppServer\java\bin\java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pwa6460_26sr8fp26ifix-20160708_01(SR8 FP26+IX90174))
IBM J9 VM (build 2.6, JRE 1.6.0 Windows 8 amd64-64 Compressed References 20160406_298378 (JIT enabled, AOT enabled)
J9VM - R26_Java626_SR8_20160406_0830_B298378
JIT  - tr.r11_20160328_114192
GC   - R26_Java626_SR8_20160406_0830_B298378_CMPRSS
J9CL - 20160406_298378)
JCL  - 20160507_01

C:\Windows\system32>

Find the target JDK and check its version.

The JAR packages of the JDBC driver vary depending on the JDK version. Only when you are clear about the JDK version can you download the corresponding driver.

Downloading of the JDBC Driver Package

The current version is JDBC 42.2.23.

This JDBC is the target driver to be downloaded unless you have special requirements (run the old application programs or JVM). It supports PostgreSQL 8.2 or later and requires Java 6 or a higher version. It also supports the SSL and javax.sql packages.

JDBC 4.2 applies when you use Java 8.
JDBC 4.1 applies when you use Java 7.
JDBC 4.0 applies when you use Java 6.

The links for downloading JDBC of certain versions corresponding to the JDK of specific versions are as follows:

JDK Version Website of the Corresponding JDBC Driver
1.6 https://jdbc.postgresql.org/download/postgresql-42.2.23.jre6.jar
1.7 https://jdbc.postgresql.org/download/postgresql-42.2.23.jre7.jar
1.8 https://jdbc.postgresql.org/download/postgresql-42.2.23.jar

img

The best choice is to use JDBC 42.2.23 because it supports PostgreSQL 8.2 or a higher version and is the most stable version.

Download website: https://jdbc.postgresql.org/download/


Configuration Process

Database Name User Password Port IP Address
postgres postgres 123456 5432

Confirmation of Port Connection

On the middleware server, access the IP port using Telnet and make sure that the database port can be accessed.

Console Configuration

Configuring the JDBC Provider

a. Create a JDBC provider.

img

b. Create another JDBC provider.

org.postgresql.ds.PGConnectionPoolDataSource

img

c. Specify the driver path.

img

d. Click Next to save the configuration.

img

Configuring Data Sources

a. Create a data source.

img

b. Fill JNDI with related information.

img

c. Select the existing JDBC provider.

img

d. Select the default option.

img

e. Click Next.

img

f. Save the configuration.

img

Configuring Database Authentication

a. Click the configured pgtest data source.

img

b. Configure the JAAS - J2C authentication data.

img

c. Create authentication.

img

d. Specify the user and password and specify the alias as you will.

img

e. Save the configuration.

img

f. Click the configured pgtest data source again and configure security settings.

img

g. Save the configuration.

Customizing Properties

a. Click the configured pgtest data source.

img

b. Customize the properties.

img

c. Click the filter icon.

img

d. Filter serverName.

img

e. Click serverName.

img

f. Fill the IP address of the target database.

img

g. Save the configuration.

h. Similarly, filter portNumber/databaseName.

img

img

Restarting the Server to Test Connection

img

img


MogDB Connected Using the openGauss Driver

openGauss JDBC provides only JDK 1.8. Applications developed using JDK 1.8 can connect MogDB using the openGauss driver.

Applications developed using JDK 1.6 or 1.7 can connect MogDB using only the JDBC driver from the PostgreSQL official website.

Website for downloading the openGauss driver:

https://opengauss.org/en/download/


Common Questions

The driver version does not match the JDK version.

img

Copyright © 2011-2024 www.enmotech.com All rights reserved.