Geeta, thanks for replying, now i have a question, i want to use a method where i can encapsulate all the process like this:
LoginHandler.class ... execSQL SQLObject = new execSQL() SQLObject.execUpdate(Query) ... and in execSQL.class is all the instructions to instantiate the pool, but... execSQL is not a servlet, so, it does not have an init method. What do I have to do so i can use execSQL as a bridge? >From: Geeta Ramani <[EMAIL PROTECTED]> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java > Servlet API Technology." <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: Re: Connection Pool Class >Date: Wed, 15 May 2002 17:09:43 -0400 > >Iv�n: > >Declare your pool as static and initialise it in the init() method of your >LoginHandler class. That should solve your problem. > >Regards, >Geeta > >Iv�n Escobedo wrote: > > > hi everybody i have a difficult problem to explain, cause my english is >not > > so good, so, i'll try to make myself clear. > > > > I need to connect to a database thru the jdbc driver to sybase. > > I already have a connectionPool.class > > I made a execSQL.class that executes commands to the database, like, >queries > > and updates, this execSQL.class request connections to the > > connectionPool.class > > ExecSQL.class has a public method where I establish the IP, Port, > > Databasename, initial and maximun conenctions, etc, so, the > > connectionPool.class knows where to make the connections. > > I have a servlet class called LoginHandler.class where I instanciate a > > ExecSQL.class to validate the user. > > > > The problem is this: > > Every time i reload the loginHandler.class it creates N (initial) > > connections to the database no matter the existents. I guess it is > > instantiating an entire new connectionPool. > > What I need is that every different class i use that instanciates a > > execSQL.class use the same connectionPool already created. > > How can I do this? What do I have to change in the classes above? > > > > Note: Only the loginHandler is a servlet. execSQL.class and >connectionPool > > are ordinary classes, and connectionPool.class implements Runnable. > > > > thanks > > > > _________________________________________________________________ > > MSN Photos es la manera m�s sencilla de compartir e imprimir sus fotos: > > http://photos.msn.com/support/worldwide.aspx > > > > >___________________________________________________________________________ > > 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 > _________________________________________________________________ Hable con sus amigos en l�nea, pruebe MSN Messenger: http://messenger.msn.es ___________________________________________________________________________ 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
