Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.
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;
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()); }
What version of webMethods was this made with?
I tried this with version 10.11 and it could not find the imports.
This code is exactly what I'm looking for, I'm was looking for code that could pull the password from the connection info and then use it with code that utilizes java.sql as opposed to the JDBC connector due to having it work that way already.
Works like a charm. Thank you for sharing.