AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

do self references cause memory leaks in Java?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
RC
Guest





PostPosted: Wed Jul 23, 2003 12:25 pm    Post subject: How to set JDBC connection timeout? Reply with quote



The Subject says its all.

I can't do

DriverManager dm = new DriverManager();

But I can do

Connection c = DriverManger.getConnection("jdbc:......", properties);

My question is how do I use

DriverManger.setLoginTimeout(10);

to set the connection time out. If after 10 seconds still not
able to connect to the database, then time out. throw to
Exception
By default if there is something wrong with the database server
or the host. It may takes 30 seconds to catch in Exception.
I want to shorter it to only 10 seconds. How do I do that?

Thank Q very much in advance!

Back to top
Sudsy
Guest





PostPosted: Wed Jul 23, 2003 3:00 pm    Post subject: Re: How to set JDBC connection timeout? Reply with quote



RC wrote:
Quote:
The Subject says its all.

I can't do

DriverManager dm = new DriverManager();

But I can do

Connection c = DriverManger.getConnection("jdbc:......", properties);

My question is how do I use

DriverManger.setLoginTimeout(10);

to set the connection time out. If after 10 seconds still not
able to connect to the database, then time out. throw to
Exception
By default if there is something wrong with the database server
or the host. It may takes 30 seconds to catch in Exception.
I want to shorter it to only 10 seconds. How do I do that?

Thank Q very much in advance!


DriverManger.setLoginTimeout(10);
Connection c = DriverManger.getConnection("jdbc:......", properties);


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.