Whether you use connection pooling or not, you should try to isolate the code that does a translation between the RDBMS world and the OO world. This way, if you switch to a different storage mechanism (you discover that your RDBMS is too slow and decide to use flat files, for example...8-), your changes will be isolated to one part(s) of your program. Moreover, when it comes to passing through parameters as you suggest, maybe think of a factory that can manufacture objects given those parameters, and don't have any SQL type stuff any where in your code but in the factory(s).
HTH. At 09:54 AM 4/9/02 -0700, you wrote: >Hi: > >When an application needs several querys (selects and updates), what's better, >have only one Connection object, Statement, ResultSet, DataMetaData and pass >through parameters to methods OR within each method have your Connection, >Statement, ResultSet, and DataMetaData objects. > >One more question, if is necesary have a query into another query, what's >better, use 2 set of objects (Connection, Statement, ResulSet, >DataMetaData) OR >to make one query and put the results into a Vector object then do the other >query (use only a set of objects). > >In your experience people, what's better for both cases? > >___________________________________________________________________________ >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff SERVLET-INTEREST". > >Archives: http://archives.java.sun.com/archives/servlet-interest.html >Resources: http://java.sun.com/products/servlet/external-resources.html >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
