• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding setLoginTimeout(int seconds) in JDBC

 
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
Saloon Keeper
Posts: 4028
18
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