Again, show us some code to indicate where you're stuck. I'm thinking something like a method with a ResultSet and a BufferedOutput as arguments. Have you gotten far enough to call something like that?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi