I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions "select", "insert", "delete". These functions either load the bean, insert the bean values in the database, or delete the record from the database. In all of these functions, I pass in a database connection from the action. (Or whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if someone has come up with something better.
 
Thanks,
Ryan
 

Reply via email to