File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Out of Sync error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Out of Sync error" Watch "Out of Sync error" New topic

Out of Sync error

Reggie McDougal
Ranch Hand

Joined: Sep 27, 2004
Posts: 69
Hi there wondering if some one can help

I am having probs with the following code

I have a HashMap storing data which I retrieve and want to write to the database, but the code executes OK but does not write to the DB. and debug tells me that the method addRecord is (out of sync)

Can some one give me a hand with this.

You can never drink too much
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

"Private Parts",
Welcome to the JavaRanch! We're pretty light on rules round these parts, but one rule we take quite seriously is the one on display names. You can read the full version here.

Basically we require your display name to be two words: your first name, a space, then your last name. Obviously fictitious names are not allowed..

Please edit your profile and select a display name which matches the display name rules. PLease do it soon, since accounts with invalid display names get deleted, often without warning.

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Are you sure an exception is not being thrown and you're missing it? Depending on the servlet container you'e using, System.out's may not be retained. That is, they get discarded and not displayed or saved anywhere. Better to look into a logging framework like Log4J.

You're not really handling the exceptions, so it may be better to propagate them ie throw them out of the method. Other than that the code looks fine, but I didn't look too closely.
I agree. Here's the link:
subject: Out of Sync error
It's not a secret anymore!