Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

big report error [SQLServer 2000 Driver for JDBC]Error establishing socket

843854Jul 29 2004 — edited Jul 29 2004
hi there,

I face one problem working with MS SQL 2000 and JDBC.

It is one web application, everything is working fine, I just have problem with one big report.

There is one servlet, which executes about 250 sql statements (selects and inserts), when its run several times after another, I get this error:
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
	at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
	at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
	at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
	at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
	at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
	at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
	at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
	at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at ObjectBase.JConnection.<init>(JConnection.java:45)
Its allways different, sometimes it takes 5 executions to get that error, sometimes 7 or 10.
When the error occurs, every servlet (even other part from the application with 1 sql statement) trying to connect to this SQL Server gets this error. It takes a few minutes after which this error does not come, it looks like a timeout.

I looked at the MS SQL Server / Process Info, there you can see the number of processes growing up to about 1500 and than decreasing to 300 and growing again, while the reports are running

I execute the sql statements like this:
//create connection
Connection m_oConnection;
Class.forName(properties.getProperty("SQLDRIVER")); // MSSQLServer JDBC Driver
m_oConnection = DriverManager.getConnection(dbUrl,user,password); //  PostgreSQL, MySQL
//execute sql
m_oConnection.createStatement().executeQuery("select * from table");
m_oConnection.createStatement().executeUpdate("insert into table...");
If some has any idea how I can avoid this problem, pleas let me know,
thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2004
Added on Jul 29 2004
2 comments
119 views