prepareCall creating database connections



Hi,

I am calling a stored procedure on MS SQL Server using the MS JDBC
drivers with code like this

CallableStatement cs = dbConnection.prepareCall("{call sp_myproc(?)}");
cs.setString(1, value);
cs.execute();

I noticed that my process was establishing a lot of connections to the
database and after some investigation realised that each call to
prepareCall() was creating it's own database connection. I added a call
to cs.close() at the end of the method which solved the imediate
problem.

My concern now is that every time I call prepareCall it is establishing
it's own database connection which must be slowing my process down. Is
there a way of just using the existing connection for the call?

Thanks
Andy

.