At the risk of being downvoted, two mostly OT and probably irrelevant for you, cmts:
As far as the first point goes, I have only extremely limited experience with this stuff myself, but there may be preferable approaches to interfacing with DBses. Here at work they're all enthusiastic with
.