Connections aren't really like Sockets. They're well "connections" to the database. Think of them as being a part of the database moved over into your Java program.
The problem with sharing a single connection is that transactions in
JDBC are done at the connection level. You most certainly do NOT want multiple servlet threads to participate in the same transaction. That's why the common solution is to pool them so that each
thread gets one of N connections out of a pool and then releases it back to the pool when it's finished with its transaction.
Kyle
------------------
Kyle Brown,
Author of
Enterprise Java (tm) Programming with IBM Websphere See my homepage at
http://members.aol.com/kgb1001001 for other WebSphere information.