import java.sql.*; public class PreviousTest { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5750/template1","jurka",""); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM pg_class WHERE relname='tablethatdoesnotexist'"); rs.next(); rs.next(); rs.next(); rs.previous(); rs.close(); stmt.close(); conn.close(); } }