Basic question

Hi, can someone help me with the problem Im having. I dont know how to do a class that takes care of creating database connection. For example if db changes I have to do changes only in one place instead all the places where I created connection. Please help?

My advise is that you use connection pooling. for instance, www.javaexchange.com. And yes, it is for free. with javaexchange you specify in a single servlet the database you are going to use, minimum number of connections, maximum number of connection, etc. in other words, it acts as a broker. You just make use of the connection and free them when you are done. in this way if you change your database you only change the database name and the driver (if you need to change it) in a single place. cheers

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury

Martin Schneider
Ranch Hand

Joined: May 16, 2002
Posts: 42

posted Jun 16, 2002 23:56:00

0

Thanks Andres, but if I understand correctly I need to have a server to run servlet? I guess what I need is some sort of class doing