Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding setLoginTimeout(int seconds) in JDBC  RSS feed

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The docs say that

public static void setLoginTimeout(int seconds)

Sets the maximum time in seconds that a driver will wait while attempting to connect to a database.

Now if i set a Connection TimeOut for 5 secs , and how can i throw an exception on this if it exceeds 5 secs ??

 
Scott Selikoff
author
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will throw the exception for you. You can catch it by putting a try/catch around the connection code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!