- Connect said Integration Server using designer. Create a package and set dependency of it on WmART and WmJDBCAdapter package.
- create a java service in that package.
- 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;
- 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());
}
- Run the service. Your password will be in Server logs.
2 Likes
Bari_Khan
(Bari Khan)
2
Works like a charm. Thank you for sharing.