This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void executeQuery() { | |
logger.info("executeQuery()... "+getQuery()); | |
super.executeQuery(); | |
logger.info("executeQuery()... completed: "+getFetchedRowCount()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void getAllQueuesInfo() { | |
try | |
{ | |
final ObjectName sibMes = new ObjectName( | |
"WebSphere:type=SIBMessagingEngine,*"); | |
final Set sibMesSet = AdminClient.queryNames(sibMes, null); | |
for (Iterator i = sibMesSet.iterator(); i.hasNext();) { | |
final ObjectName meObj = (ObjectName) i.next(); | |
final String meName = meObj.getKeyProperty("name"); | |
final ObjectName queuePoints = new ObjectName( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com.microsoft.sqlserver.jdbc.SQLServerException: The operation could not be | |
performed because OLE DB provider "SQLNCLI10" for linked server "TEST-DB" was | |
unable to begin a distributed transaction. | |
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source) | |
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source) | |
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source) | |
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source) | |
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source) | |
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source) | |
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Properties props = new Properties(); | |
props.put(AdminClient.CONNECTOR_TYPE,AdminClient.CONNECTOR_TYPE_SOAP); | |
props.put(AdminClient.CONNECTOR_HOST, hostname); | |
props.put(AdminClient.CONNECTOR_PORT, port); | |
props.put(AdminClient.USERNAME, username); | |
props.put(AdminClient.PASSWORD, password); | |
props.put(AdminClient.CONNECTOR_SECURITY_ENABLED, "true"); | |
props.put("javax.net.ssl.trustStore", trustStoreLocation); | |
props.put("javax.net.ssl.trustStoreType", "JKS"); | |
props.put("javax.net.ssl.keyStore", keyStoreLocation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final MBeanFactory mbfactory = AdminServiceFactory.getMBeanFactory(); | |
final MBeanServer server = mbfactory.getMBeanServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ObjectName sibMes = new ObjectName( | |
"WebSphere:type=SIBMessagingEngine,*"); | |
final Set sibMesSet = server.queryNames(sibMes, null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (Iterator i = sibMesSet.iterator(); i.hasNext();) { | |
final ObjectName meObj = (ObjectName) i.next(); | |
final String meName = meObj.getKeyProperty("name"); | |
final ObjectName queuePoints = new ObjectName( | |
"WebSphere:type=SIBQueuePoint,SIBMessagingEngine=" | |
+ meName + ",*"); | |
final Set queueNameSet = server.queryNames(queuePoints,null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Iterator it = queueNameSet.iterator(); | |
while (it.hasNext()) { | |
final ObjectName obj = (ObjectName) it.next(); | |
final String name = obj.getKeyProperty("name"); | |
AttributeList attribList = server.getAttributes(obj, | |
new String[] { "depth", "state", "id", | |
"highMessageThreshold", "sendAllowed" }); | |
Long depth = null; | |
String state = ""; | |
String id = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (null != depth && depth > 0) { | |
System.out.println("Queue Name:" + name | |
+ " has queue depth:" + depth); | |
SIBQueuedMessage[] msgs = (SIBQueuedMessage[]) server.invoke(obj, | |
"getQueuedMessages", null, null); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int i = 0; i < msgs.length; i++) { | |
SIBQueuedMessage msg = (SIBQueuedMessage) msgs[i]; | |
System.out.println("id:" + msg.getId() + ", name:" | |
+ msg.getName() + ", state:" + msg.getState() | |
+ ", transactionID:" + msg.getTransactionId() | |
+ ", type:" + msg.getType()); |
OlderNewer