Posts tagged generator
PL/SQL Table-to-Java Bean (and Data to Java Bean Manager) generator – useful for data driven demos without database
The other day, I sat preparing for a demonstration of a data driven Java Web application. I preferred to be able to present the demo without actually having to use the database – as it takes a lot of time to start and too many resources from my hard press laptop. I only needed several dozens of records to show in the web pages, nothing too serious.
I decided it would be convenient to have a quick way of creating Java Beans from my table definitions (very much like many JPA tools & frameworks can do) and generate code that will instantiate a series of objects based on those bean definitions with the same data that also live in my database. I can then shutdown the database, yet continue working with data in my Java application. This article introduces a PL/SQL package that will do this for me.
The result of running this package for tables EMP and DEPT looks like this – and allows me EMP & DEPT based demonstrations without the need for a database up and running!