How to get JDBC connection password without Integration Server restart

  1. Connect said Integration Server using designer. Create a package and set dependency of it on WmART and WmJDBCAdapter package.
  2. create a java service in that package. 
  3. Add below imports.
import com.wm.pkg.art.error.DetailedException;

import com.wm.pkg.art.error.DetailedServiceException;

import com.wm.pkg.art.ns.ConnectionDataNode;

import com.wm.pkg.art.ns.ConnectionDataNodeManager;

import com.wm.adapter.wmjdbc.connection.JDBCConnectionFactory;

import    com.wm.util.Debug;

  1. Write below code. Here String connName is actual connection name whose password is required.
     
String connName = "Your_connection_name";

try {

ConnectionDataNode connectionDataNode = ConnectionDataNodeManager.getConnectionDataNode(connName);

Debug.log(4, ((JDBCConnectionFactory)connectionDataNode.getConnectionResource().getManagedConnectionFactory()).getPassword());

}catch(Exception ex){

throw new ServiceException(ex.getMessage());

}
  1. Run the service. Your password will be in Server logs.
2 Likes

Works like a charm. Thank you for sharing.