@Override public int doGetMessageCount(TransactionContext c, ActiveMQDestination destination) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { s = c.getConnection().prepareStatement(this.statements.getDestinationMessageCountStatement()); s.setString(1, destination.getQualifiedName()); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }
public int doGetMessageCount(TransactionContext c, ActiveMQDestination destination) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; cleanupExclusiveLock.readLock().lock(); try { s = c.getConnection().prepareStatement(this.statements.getDestinationMessageCountStatement()); s.setString(1, destination.getQualifiedName()); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { cleanupExclusiveLock.readLock().unlock(); close(rs); close(s); } return result; }
@Override public int doGetMessageCount(TransactionContext c, ActiveMQDestination destination) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { s = c.getConnection().prepareStatement(this.statements.getDestinationMessageCountStatement()); s.setString(1, destination.getQualifiedName()); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }
@Override public int doGetMessageCount(TransactionContext c, ActiveMQDestination destination) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { s = c.getConnection().prepareStatement(this.statements.getDestinationMessageCountStatement()); s.setString(1, destination.getQualifiedName()); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }
@Override public int doGetMessageCount(TransactionContext c, ActiveMQDestination destination) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; int result = 0; try { s = c.getConnection().prepareStatement(this.statements.getDestinationMessageCountStatement()); s.setString(1, destination.getQualifiedName()); rs = s.executeQuery(); if (rs.next()) { result = rs.getInt(1); } } finally { close(rs); close(s); } return result; }