Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Mysql jdbc connection takes lot of time

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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) ??
 
loganathan kalyan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic