Blogger

Delete comment from: Javarevisited

Anonymous said...

One of the less common JDBC best practices I have seen is making your DAO class name identical as Table name, for example if you have Customer table than your DAO class should be called CustomerDAO, similarly if you have Product table than you can name it ProductDAO. In a case where your table name is more complicated and picking up as Java class name doesn't make sense, then consider declaring a public static final String TABLE = "ABC_XYZ", this makes easy to correlated which table a particular DAO class is connecting. Ideally you should know table name by just looking name of DAO class, but in worst case it must contain such field at top of the class.

Feb 24, 2014, 10:21:21 PM


Posted to Top 10 JDBC Best Practices for Java Programmers

Google apps
Main menu