Hi there
My Easter is great, what about yours?
I am not pretty sure if that is a thing and it has been a while since I did 
Java, but I have the feeling that you actually should move the statement from 
try(...), so the statement between the parenthesis, within the braces.
Like this:
try {
        PreparedStatement stmnt = sqlConnection.prepareStatement("SELECT * FROM 
entries");
And so forth.
Besides, are you 200 percent sure that you are actually loading the right 
database?
Can you go over this entire thing using a debugger?
Hope to hear from you and I really hope that helped you a little out there.
Regards, Jordy

-----Oorspronkelijk bericht-----
Van: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> Namens Tommy 
Lane
Verzonden: zondag 21 april 2019 18:35
Aan: sqlite-users@mailinglists.sqlite.org
Onderwerp: [sqlite] JDBC stmnt.executeQuery returns empty ResultSet

All,
        Hope you Easter is going well.

        I am working on a simple journaling application which I'm choosing to 
write in Java. Before I get into this description if this is not the place to 
ask for help with the sqlite wrapper
(https://bitbucket.org/xerial/sqlite-jdbc/downloads/) please let me know, 
although I won't need a plethora of replies to that effect.

        When I execute a chunk of code:
ResultSet getTitles() {
           ResultSet ret = null;

           try (PreparedStatement stmnt = 
sqlConnection.prepareStatement("SELECT * FROM entries")) {
                  ret = stmnt.executeQuery();

           } catch (SQLException ex) {
                  System.out.println("Unable to get entries from the entry 
database.");
                  System.out.println(ex.getMessage());
                  ex.printStackTrace();
           }


           return (ret);
    }

my rs contains no results.

I've verified that the database which sqlConnection has open does indeed 
contain data.

ANY help would be greatly appreciated,
-Tommy <km4...@km4lvw.com>

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to