System.out.println doesn't show the actual query that hits the database. I finally got
query logging working and was able to see that, for some reason, the parameter is
not being inserted in the PreparedStatement. When the query hits the db, the "?"
mark is still actually in the query! I have another successful query that looks exactly like the one
that fails; different columns are being queried, but the successful one has the value
set in the query whereas the unsuccessful one does not. I cannot see any difference in the
There is only one parameter in both queries; it is set with setString in both cases.
My database tables are corrupted; I'm trying to restore from the output of mysqldump, but I can't seem to get the syntax correct. I will be able to work with the prepared statement problem when I get the database restored.
mysqld-nt.exe is the executable for the service, not the command line utility used to enter sql statements. You should be using mysql.exe instead. There was no renaming of mysql to mysqld-nt in MySQL 5, the windows service has always been named mysqld-nt.exe, from what I recall. If you are missing mysql.exe, then I guess you probably unselected the option for the command line utilities during installation.
I'm as red faced as the staff at JavaRanch just said they are while working on their servers; anyway, I
have absolutely no idea what i was thinking because I do have mysql.exe. I need to get some sleep!
Stayed up way too late twice this week working on a project. Very sorry.
I still can't seem to get the syntax of the command correct, but hopefully soon I will.
posted 11 years ago
Just to let you know that I was able to restore the database tables and both queries worked. It's magic and 3 days work!
Thanks to all of you.
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
Devious Experiments for a Truly Passive Greenhouse!