Please Help!!! Generic Database Access Class
posted 13 years ago
Hi, I am developing an application in java which will query and update/delete from a database (I am currently using an Access database for a prototype). The problem I have got is that I have a database schema which has relations such as - 'one client to many products'. E.g - I have got a client table and a product table with the clients primary key as the foriegn key in the product table. Amyway, at present, I have got java classes to reflect this data structure - so my client class contains a vector of product objects. I am attemting to find a generic way of executing the sql statments - at the moment, I am hard coding all sql statements which is obviously no good! I want to be able to send an object to the database and have a generic method for 'insert' which will identify the correct table and update it. (has anyone out there developed a generic database access class?)I hope this makes sense but it is difficult to explain! Any help at all would be really appreciated! Thanks in advance!