aspose file tools*
The moose likes JDBC and the fly likes Mysql jdbc connection takes lot of time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Mysql jdbc connection takes lot of time" Watch "Mysql jdbc connection takes lot of time" New topic
Author

Mysql jdbc connection takes lot of time

loganathan kalyan
Greenhorn

Joined: Apr 24, 2009
Posts: 7
If i try to create a jdbc connection for the My sql using a port which is already used by another application (oracle), it takes lot of time to get the error message.

Can anyone help to solve this issue?


Loganathan.K
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

That's may be because of the MySQL Servers instance "connection_timeout"(I don't remember that attribute, it may be "timeout", Consult MySQL site) has set to some big value.

But that's shouldn't be the issue, the point is why are you connecting to a port which is already captured by some other application(oracle) ??


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
loganathan kalyan
Greenhorn

Joined: Apr 24, 2009
Posts: 7
Sagar Rohankar wrote:That's may be because of the MySQL Servers instance "connection_timeout"(I don't remember that attribute, it may be "timeout", Consult MySQL site) has set to some big value.

But that's shouldn't be the issue, the point is why are you connecting to a port which is already captured by some other application(oracle) ??


i dont know whether the port is used by anyother application. In my project i have to provide a faciltiy to user to create connection in the port he whises. User dosent need to know whether the port is alreay used but i must show him a message if he tries to create a connection using such ports
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

loganathan kalyan wrote:i dont know whether the port is used by anyother application.

Use netstat -a command for windows machine to get port occupied by which app/process, for another OS, Google.
loganathan kalyan wrote:In my project i have to provide a faciltiy to user to create connection in the port he whises. User dosent need to know whether the port is alreay used but i must show him a message if he tries to create a connection using such ports

Either you need to run 65,536 DB Server instances for 65,536 ports OR User has to guess from 65,536 ports at which port DB Server instance is running

Whats exactly you want to do ? The way you're doing is NOT at all feasible.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

In my project i have to provide a faciltiy to user to create connection in the port he whises. User dosent need to know whether the port is alreay used but i must show him a message if he tries to create a connection using such ports
This will make your application unpopular for server / security administrators. They will think that you have built an application that is scamming their server.

Why do you need to implement this logic? What is the underlying problem that you want top solve by letting the user guess the port where a database is listening?


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mysql jdbc connection takes lot of time