A very common problem for web based systems but have not found any readymade solution yet.The approach I would take
1. Design a class DatabaseInfo which read the database usng
JDBC metadata and gets the table list and display this list to user
2. User selects the list
3. Use JDBC Metadata again to read the field names of the table along with their attributes.
4. This information needs to be stored in 2 tables. First table would have the list of tables. Second table would have the fields for each of these tables.
This is first time set up.
Now for data entry , show user the screen which has the list of tables.
User selects a table and then display the fields of the table along with their datatype in the
jsp.
user enters the values and he data tyoe validation can be done at the server.
To edit the data, user selects the table, the data is displayed in tabular format with radio buttons next to them.
User selects the edit or delete for any row, and the add screen can be populated with this data.