WebLogic, as we know, is an application server produced by American bea company. It is a relatively excellent middleware based on Java ee architecture, a pure java developed, and an excellent BEA application server. We use it a lot of times Weblogic deployment project , the WebLogic configuration MogDB data source method is recorded here.
Configuration premise
WebLogic JDK version confirmation
$ /home/jdk1.7.0_80/bin/java -version java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
Find the JDK used and check the version.
JDBC drivers have different jar packages for different large JDK versions. Only by specifying the large JDK version can the corresponding driver be downloaded.
The current environment is 1.7.0.
Download the corresponding JDBC driver package
Current version 42.2.23. This is the current version of the driver. Unless you have an unusual need (to run an old application or JVM), this is the driver you should use. It supports PostgreSQL 8.2 or higher, and requires Java 6 or higher. It includes support for SSL and javax. sql packages. If you are using Java 8 or later, you should use JDBC 4.2. If you are using Java 7, you should use JDBC version 4.1. If you are using Java 6, you should use the JDBC 4.0 version.
The link to download the JDBC version for each JDK is as follows:
JDK version |
JDBC driver link address |
one point six |
https://jdbc.postgresql.org/download/postgresql-42.2.23.jre6.jar |
one point seven |
https://jdbc.postgresql.org/download/postgresql-42.2.23.jre7.jar |
one point eight |
https://jdbc.postgresql.org/download/postgresql-42.2.23.jar |
42.2.23 is the best choice. It supports PostgreSQL 8.2 or higher and is the most stable version at present.
The download address is as follows: https://jdbc.postgresql.org/download.html
Configuration process
Confirm db related information
Database name |
user |
password |
port |
IP |
postgres |
mogdb |
one hundred and twenty-three thousand four hundred and fifty-six |
twenty-five thousand four hundred and thirty-one |
|
Confirm port connectivity
On the middleware host telnet ip port, ensure that the db port can be accessed normally
Console configuration data source
Add driver to CLASSPATH
a. Backup Startup File
cd ${DOMAIN_HOME}/bin cp startWebLogic.sh startWebLogic.sh.bak
Copy
b. Upload drive to WebLogic host
For example, the current JDK version is 1.7, which is uploaded to the specified path
/home/postgresql-42.2.23.jre7.jar
c. Modify startup file, add driver package
CLASSPATH="${SAVE_CLASSPATH}"
Change to:
CLASSPATH="${SAVE_CLASSPATH}:/home/postgresql-42.2.23.jre7.jar"
d. Restarting the server takes effect
Configure Data Source
a. New Data Source
b. Fill in JNDI and relevant information
c. Select default drive
d. Select Default
e. Fill in db information
f. Test connection
g. Ensure successful testing
h. Select server according to requirements
i. Complete the configuration and activate the change to take effect
Connect MogDB with openGauss driver
The openGauss JDBC driver only provides the JDK 1.8 version, and the applications of JDK 1.8 can use the openGauss driver to connect to and use MogDB normally.
For applications of JDK 1.6 and JDK 1.7, only the JDBC driver provided by PostgreSQL can be used to connect to MogDB.
OpenGauss driver download address: https://opengauss.org/zh/download.html
Reference article: http://docs.mogdb.io:8000/zh/mogdb/v2.0.1/weblogic -configures-mogdb(postgresql)-data-source-reference
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge