select
post_content
from posts
left(или right всегда их путаю) join post_user
inner join feeds on feeds.feedid = posts.feedid
where userid = :userid
and post_user.postid is null
and feeds.category = :category
select
post_content
from post_user
inner join posts
inner join feeds on feeds.feedid = posts.feedid
where userid = :userid
and isread = False
and feeds.category = :category
import javax.sql.rowset.CachedRowSet;
PreparedStatement q1 = conn.prepareStatement("select * from Params");
CachedRowSet r1 = new CachedRowSetImpl();
r1.populate(q1.executeQuery());
PreparedStatement q2 = conn.prepareStatement("select * from Clients");
CachedRowSet r2 = new CachedRowSetImpl();
PreparedStatement q1 = conn.prepareStatement("select * from Params");
PreparedStatement q2 = conn.prepareStatement("select * from Clients");
q1.execute();
ResultSet r1 = q1.getResultSet();
q2.execute();
ResultSet r2 = q2.getResultSet();
r1.next();//org.firebirdsql.jdbc.FBSQLException: The result set is closed
r1.getObject(1);
r2.next();
r2.getObject(1);
PreparedStatement q1 = conn.prepareStatement("select * from params");
PreparedStatement q2 = conn.prepareStatement("select * from Clients");
ResultSet r1 = q1.getResultSet();
ResultSet r2 = q2.getResultSet();
r1.next();//Exception in thread "main" java.lang.NullPointerException
r1.getObject(1);
r2.next();
r2.getObject(1);
PreparedStatement q1 = conn.prepareStatement("select * from params");
PreparedStatement q2 = conn.prepareStatement("select * from Clients");
ResultSet r1 = q2.getResultSet();
ResultSet r2 = q2.getResultSet();
r1.next();//Exception in thread "main" java.lang.NullPointerException
r1.getObject(1);
r2.next();
r2.getObject(1);
Statement q1 = conn.createStatement();
ResultSet r1 = q1.executeQuery("select * from params");
Statement q2 = conn.createStatement();
ResultSet r2 = q2.executeQuery("select * from clients");
r1.next();//org.firebirdsql.jdbc.FBSQLException: The result set is closed
r1.getObject(1);
r2.next();
r2.getObject(1);
Или так