This content has been marked as final. Show 3 replies
Communication errors mean the problem is outside of java.
- Database isn't running
- Address is wrong
- Firewall is interferring.
Your error report suggests that Eclipse itself is reporting the error, rather than a java problem. So an Eclipse forum might help.
I'm not into threads, but I suspect creating 10 threads isn't really going to buy you anything. If anything, it may hurt performance (just guessing here). My reasoning is that if your CPU is mostly processing your one query nearly 100% of the time, its efficient. If it has 10 threads, each is only using about 10% of the CPU time, plus the performance hit in continually time slicing between the threads. However, if you can fetch data from the database (which takes time), while you are processing the current batch of records, that may save time.
Best to run it late at night when few are using the computer.
Also, be careful about your sql. Example:
select * between 11/12/2010 and 11/22/2010
Gets the records between the two dates inclusive(?).
select * between 11/22/2010 and 11/25/2010
also gets the records between the two dates inclusive(?).
However, BOTH queries retrieve data from 11/22/2010(?) and therefore is redundant. The second sql should be
select * between 11/23/2010 and 11/25/2010
I'm not sure about this, but you might want to consider it.
Also, using an end date of 11/31/2010 may not be valid since november doesnt have 31 days(?). Also, leap year is a problem.
I think the better solution to this would be to have a version number (an integer or timestamp) in each record. Each time the record is updated, the version is updated. This way, you can compare version numbers rather than all fields which sould be faster. Similarly for delete and insert of new records.
If you get the system time in milliseconds before an after any operation and print out their differences when running your code, you can do a performance check.
njbt7y wrote:I suspect that is a good answer to some other question.
I'm not into threads, ...