Is there a generic approach/pattern/framework by which we just need to specify the query parameter and that will give us the respective response. I want to use a common interface (and put it into a Class) for all the sql ueries for all the JSP which should not be dependent upon the query parameter and type of query. One possible solution I can think of to use the stored procedure for all JDBC related work and pass them the necessary parameters required and get the response in return. But at present I am not very sure of the pros and cons of this strategy. Is there any other possible solution. Please enlighten...........
-ShriKant "A mailing list for discussion about Sun Microsystem's Java Servlet API Technology." wrote: > You can write an utility class kind of thing like ConnectionPool.java which > has methods like public Connection getFreeConnection() and public void > returnConnection(Connection c). > Make sure that you don't close the connections in your JSPs after use. Let > the same utility class close the connections when it decides they are not > necessary. > So that you can have the code two aquire a DB connection in one place > which will be easier when you might change the server/driver etc in future. > -----Original Message----- > From: Sumit Mishra [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 28, 2002 10:31 AM > To: [EMAIL PROTECTED] > Subject: Connection in JSPs? > > Hi, > > What can be the best way of taking connection in a JSP when u have to fire > a query in almost every JSP? Is the useBean approach ok?? > > Regards, > Sumit ___________________________________________________________________________ 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
