Article ID: 313220 - View products that this article applies to.
This article was previously published under Q313220
When you use multiple JDBC statements on a single connection, you may see multiple connections implicitly created by the Microsoft SQL Server 2000 Driver for JDBC.
If you open your database connection with the SelectMethod property set to Direct (the default setting), only one statement at a time can be active on the connection. When you create a second statement, the driver implicitly opens a new connection to handle the new result set.
The following two methods prevent implicit connections:
Steps to Reproduce the BehaviorThe following code demonstrates a scenario where the driver creates an implicit connection:
An INSERT statement is used in the example, but the contents of the SQL statement that is used is not important. If you use a tool such as SQL Profiler to observe the connections that are made to the SQL Server, you notice that as soon as the second statement is created, the implicit connection is made.
For complete details on the SelectMethod property, see the documentation for the Microsoft SQL Server 2000 Driver for JDBC.
Article ID: 313220 - Last Review: June 5, 2002 - Revision: 1.0