[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Connecting to a DB....([BEA][SQLServer JDBC Driver]No more data available to read.)  XML
Forum Index » J2EE Application Development
Author Message
tfecw

Newbie

Joined: 09/19/2005 15:02:20
Messages: 144
Location: No. VA.
Offline


[BEA][SQLServer JDBC Driver]No more data available to read. is the latest and greatest JDBC error I’ve gotten. I've posted some other threads on database related question in the past and I'm kind of at a junction where having a mentor at work would come in handy because i have a knack for finding connection handling (or lack there of) issues.

For the most part on the handful of apps I’ve built I use the following pattern to handle connections. As i progress through my apps and I mature as a developer it gets slightly more sophisticated, but here goes.
This code won't compile and obviously isn't complete (I’ll try and come up with a working example here in the next day or so)



Then in where ever i actually need a connection i do the following:



I'm in a j2ee environment so threading could be/is an issue here. Am I closing all my connections here?
Here's my understanding of what's going on.
connPing, pStatementPing & resultSetPing are created and stuff is done with them. Then a pass a copy of their reference to closeConnections().
Close closes the 3 objects, but the null assignment only affects conn, pStatement, & resultSet. When closeConnections() finishes running we go back to the of the finally and ultimatly out of pingDB()
I don't need to assign null to connPing pStatementPing, and resultSetPing since they drop out of scope (after being closed in closeConnections()) after the finally anyways.

So that's my understanding of what's going on. Assuming that the above is true and that I haven't confused myself (or anyone reading this ) I'm fairly confident that I'm handling my connections properly.

So now for this SQLException...I'm kinda clueless. I did the ol google and read a bunch of them and it seems like one of those fun errors that a decent amount of folks get and no one really knows what to do about it. The most popular answer is that the connections aren't being handled properly. I also saw a hit about weblogic being not being configured properly, and then finally someone thought it was a threading issue.

So i guess all this confusing inner dialog boils down to 2 questions.
Is using static methods in a different class to get & close connections okay in terms of proper connection management?

The second question would be any thoughts or solutions on this SQLException I'm getting.
aim icon
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 751
Location: Superior, CO, USA
Offline

I totally missed this posting before - sorry about that. Did you get this solved?

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
tfecw

Newbie

Joined: 09/19/2005 15:02:20
Messages: 144
Location: No. VA.
Offline

I totally missed this posting before - sorry about that. Did you get this solved?



No worries, I don't remember writing this one!

restarting the server def fixes the problem (in the short term). There was a setting we had to enable/disable in weblogic to fix it for good. I'll see if i can't get more details on monday so we can update this for posterity.
aim icon
 
Forum Index » J2EE Application Development
Go to:   
Powered by JForum 2.1.8 © JForum Team
This site built by Scott Dunbar of Xigole Systems. © 2005-2010 - Scott Dunbar
Java and the Java Get Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
hotjoe.com and xigole.com have no affiliation with Sun Microsystems, Inc.