Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 16th, 2003, 04:37 AM
names names is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 names User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ConnectionRead Exception

Hi all,

I have an application in java run at tomcat server, sometimes when it connects to sql 2000 database using jdbc-odbc the following exception is thrown

java.sql.sqlException [microsoft][ODBC sql server][DBNETLIB] ConnectionRead (recv())

what does this mean?

thanks

Reply With Quote
  #2  
Old July 16th, 2003, 08:49 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Can you post a snippet of the exceptions that are being caught?

Reply With Quote
  #3  
Old July 16th, 2003, 11:18 AM
names names is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 names User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sure, but actually the caught exception is exactly the line I've sent

the scenario in which this exception is thrown is:

1- In my class I define a static section for the connection like this

static
{
try{
con = DriverManager.getConnection("jdbc: odbc: sqlDSN","username","pass");
st = con.prepareStatement("Select * from [tbl1]");
} catch(Exception ex) {
System.err.println(ex);
}
}


2- Then a function is called every 3 sec to execute the line
rs = st.executeQuery();
on the previously defined st (which is defined once)

and process the result

that is all

every thing goes well for sometime then that exception is thrown!!!


thanks

Reply With Quote
  #4  
Old July 16th, 2003, 10:38 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Can you try catching the SQLException error? It seems as if you are unable to connect to the MS SQL Server.

Reply With Quote
  #5  
Old July 17th, 2003, 01:33 AM
names names is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 names User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The line rs = st.executeQuery(); is in try..catch block

I agree with u, it seems as if it is unable to connect to the MS SQL Server

But I wonder, this exception appears after many times of sucsses connections by the same line, as I said the function that contains this line (rs = st.executeQuery()) is called once every 3 sec

Why it sometimes works fine and other times give this exception?

My only weak interpretation is that the connection (which is defined once in the static block) loses its validity after sometimes for some reason....is it logic?

Reply With Quote
  #6  
Old July 17th, 2003, 10:42 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Are you reusing the connection over and over again or are you instantiating the connection again and again?

Reply With Quote
  #7  
Old July 20th, 2003, 11:50 AM
names names is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 names User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm reusing the connection again and again not instantiating the connection again and again

Reply With Quote
  #8  
Old July 20th, 2003, 03:02 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Is there a long delay at times that could be causing a driver or database timeout?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > ConnectionRead Exception


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway