L
Lawrence D'Oliveiro
Not at all - I want to see what you conveniently left out.
I left out the stuff to reduce the amount of Java code you had to write.
That includes code needed to shut down cleanly, which is entirely missing.
Omitting that is scarcely professional even for a one-off script.
Shut what down cleanly?
In Java all that can be sucked in with under 10 statements as a property
list and writing a completely general purpose RDBMS -> CSV converter
would be a fairly trivial exercise.
Do it, then. For 39 fields from one table, and 8 from the second one.