This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Socket Timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Socket Timeout" Watch "Socket Timeout" New topic
Author

Socket Timeout

Ben Narendren
Greenhorn

Joined: Oct 01, 2009
Posts: 19
Hi,

I am trying to put in a Socket time out on a Oracle JDBC connection. I googled it and didn't find much. I use DriverManager.getConnection(connectionString); to create connections. Anybody has any ideas how to do this? Any help is greatly appreciated.

Thanks
Ben
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

A Socket timeout? for a DB Connection?

Don't you mean a statement or transaction timeout?

WP
Ben Narendren
Greenhorn

Joined: Oct 01, 2009
Posts: 19
I mean a connection level socket timeout which will be invoked if the physical connection is lost and the thread is hanging.
Martin Vajsar
Bartender

Joined: Aug 22, 2010
Posts: 2331
    
    2

Have you found this? The Oracle connection apparently recognizes the oracle.jdbc.ReadTimeout property. I don't have any experiences with the more exotic connection properties though, and this area is quite muddy for me.
Ben Narendren
Greenhorn

Joined: Oct 01, 2009
Posts: 19
Thanks Martin. I think this is what I was looking for.
Martin Vajsar
Bartender

Joined: Aug 22, 2010
Posts: 2331
    
    2

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Socket Timeout
 
Similar Threads
Socket reuse and security
How to reset the socket time out
new to Socket prgramming
socket's http connection
EJB listening on a client socket for callbacks