On 19/04/21 08:25, jordydew...@gmail.com wrote:
> Hi there My Easter is great, what about yours?
Jordy, Mine is going well too, thanks.?n
> 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.
While I totally believe that looks odd, I don't normally use this _try_ syntax
normally, it is valid. Not sure when the standard was updated to support that
method.
> Like this: try { PreparedStatement stmnt =
> sqlConnection.prepareStatement("SELECT * FROM entries");
I have moved my statement into the try block, mainly because it helps with
readability.
> Besides, are you 200 percent sure that you are actually loading the right
> database?
I only have a single Database instance in this whole program, the Database class
I wrote works off a singleton design pattern. (there is only one instance of the
main class type).

> Can you go over this entire thing using a debugger?
I am currently running over it with the default debugger used by NetBeans IDE.
However, the packaging of the JDBC library I'm using doesn't provide source code
which I am able to step through. I'm inspecting the variables as I get access to
them, like the ResultSet I get back from the execute function.
> Hope to hear from you and I really hope that helped you a little out there.
It did actually help me realize the database I was connecting to from the cli,
and the one I called from the connection were different, however the problem
persists.

> Regards, Jordy


I actually figured out the problem when I was verifying what I was saying in
this reply.  Turns out executeQuery() cannot be called on a PreparedStatement.
This little nugget was hidden at the end of the docs for the method.

Thanks for the help!  -Tommy <km4...@km4lvw.com>Thanks for the help!
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to