Vita Rara: A Life Uncommon

XML

Separating SQL and Java Code


Categories: | |

I have been programming in Java for about eight years now. One of the persistent issues I have had is writing programs that will work with more than one database. In general I use EJB to handle persistence in my business layer. The issue that has remained is keeping SQL out of the code for simple things like screen displays and report generation, either to the screen or to PDF files for printing.

I've done some looking around and have not found a solution yet. I might be missing it, and if you know of one please let me know. In the mean time myself and my fellow programmer John came up with the following. It is by no means complete. This is an idea at this point, but one I think has merit.

Syndicate content