/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.juick.server; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; /** * * @author ugnich */ public class SubscriptionsQueries { public static ArrayList getJIDSubscribedToComments(Connection sql, int mid, int ignore_uid) { ArrayList jids = new ArrayList(); PreparedStatement stmt = null; ResultSet rs = null; try { stmt = sql.prepareStatement("SELECT jid FROM subscr_messages WHERE message_id=? AND active=b'1' AND suser_id!=? AND jid!=''"); stmt.setInt(1, mid); stmt.setInt(2, ignore_uid); rs = stmt.executeQuery(); rs.beforeFirst(); while (rs.next()) { jids.add(rs.getString(1)); } } catch (SQLException e) { System.err.println(e); } finally { Utils.finishSQL(rs, stmt); } return jids; } }