File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes MySQL table not updating... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySQL table not updating..." Watch "MySQL table not updating..." New topic

MySQL table not updating...

james hagbard

Joined: Sep 27, 2009
Posts: 8
I am summarizing a MySQL database.
I have a table called Race with 245 columnes and 20,000+ rows.
I am adding up the data in the columns and trying to insert that into another table called Race_summary which will have all the same columns but only 1 row.

I am attempting to do this somewhat generically so I can reuse the code at a later time (and I have 2 other databases to summarize).

here is the code I am using:

the println line is printing the values to the screen and showing the correct values, however when I check the table after running the program the values are not getting updated.

Am I missing something simple?
Jan Cumps

Joined: Dec 20, 2006
Posts: 2491

Hi James,

Can you print the string updateSummary , and show us what it says?
executeUpdate() returns the number of rows that are updated by your updateSummary. Can you print and show us this value?
Try if commit after the update helps.


OCUP UML fundamental and ITIL foundation
youtube channel
I agree. Here's the link:
subject: MySQL table not updating...
Similar Threads
transferring ResultSet from EJB to JSP/Java Class
help!! ResultSet error
Java ResultSet
Java ResultSet
passing table names at runtime