Required Tool and Software:
- OpenJDK / Oracle JAVA
- dbconnect.jar
- ojdbc8.jar
- postgresql-42.6.0.jar
- mssql-jdbc-12.2.0.jre8.jar
Download link for dbconnect.jar and ojdbc8.jar and other .jar’s
https://drive.google.com/drive/folders/1H0UI62dmVnAQmKmPSRMrztmzrq1y49to?usp=drive_link
TEST Connection for Oracle,
Command:
/usr/bin/java -cp /opt/test/dbConnect.jar:/opt/test/ojdbc8.jar com.sid.dbConnect jdbc:oracle:thin:@123.789.123.456/SERVICENAME “$username” ‘$Password’ oracle.jdbc.driver.OracleDriver
TEST Connection for POSTGRESQL,
Command:
/usr/bin/java -cp /home/app/test/dbConnect.jar:/home/app/test/postgresql-42.6.0.jar com.sid.dbConnect jdbc:postgresql://123.456.123.789:1234/postgres “$username” ‘$Password’ org.postgresql.Driver
TEST Connection for MSSQL, with SSL and NON_SSL :
Command: With SSL and Protocol TLS1.2:
/opt/java_1.8_64/bin/java -cp /tmp/dbConnect.jar:/tmp/mssql-jdbc-12.2.0.jre8.jar com.sid.dbConnect "jdbc:sqlserver://123.456.123.789:44332;databaseName=MSSQLDB;encrypt=true;trustServerCertificate=false;sslProtocol=TLSv1.2;" "$USERNAME" ‘$PASSWORD’ com.microsoft.sqlserver.jdbc.SQLServerXADataSource
Command: Without SSL:
/opt/java_1.8_64/bin/java -cp /tmp/dbConnect.jar:/tmp/mssql-jdbc-12.2.0.jre8.jar com.sid.dbConnect "jdbc:sqlserver://123.456.123.789:44332;databaseName=MSSQLDB" "$USERNAME" ‘$PASSWORD' com.microsoft.sqlserver.jdbc.SQLServerXADataSource
FYI , Class Name to be used on Datasource for application servers to connect respective Oracle DB (11g / 12c / 19c ) :
- oracle.jdbc.xa.client.OracleXADataSource (for 19c and 12c DB , ojdbc8.jar with JDK8 complied)
- oracle.jdbc.pool.OracleConnectionPoolDataSource (for 11g with minimum jDK7, JDK8 complied)
New JDBC String : LOADBALANCER and failover for ORACLE Datasource
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=123.456.123.789)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=123.456.123.789)(PORT=1521))(FAILOVER=on)(LOAD_BALANCE=on))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MY_SERVICE_NAME)))
Add below parameter on JVM arguments if you were facing SSL_protcol_Handshake issue on WebSphere Application server / WebSphere liberty.
-Dcom.ibm.jsse2.overrideDefaultTLS=true
Thanks :-)
No comments:
Post a Comment