The moose likes JDBC and Relational Databases and the fly likes JDBC: Minimum network bandwidth required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC: Minimum network bandwidth required" Watch "JDBC: Minimum network bandwidth required" New topic

JDBC: Minimum network bandwidth required

Shadab F Hashmi

Joined: Feb 13, 2006
Posts: 9
Hi All,

I have a small query regarding JDBC connectivity over WAN. I have scenerio where my application is running say 'San Francisco' and Database server is at another place say 'New York'. When i want to connect to database server on WAN using JDBC, what is the minimum network bandwidth/latency required to successfully connect to database server.Does JDBC have any recommended range of latency?

Thanks inadvance for your help.

stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
There's no particular JDBC requirement. JDBC as a standard is independent of the underlying network layer, but most JDBC drivers are built on TCP/IP and merely require reasonably long-lived connections. Dealing with connection interruptions can be a significant design problem for "difficult" networking conditions. It's more a matter of whether your program can deliver acceptable performance, as judged by users.

There are two pieces of performance advice for some-one developing such a "long-haul" application:
1. connection pooling - connect time can be very significant even on a "short haul"; in a test I did recently, not using connection pooling when connecting through a VPN tunnel made a very simple test program perform 800% slower.
2. Statement.setFetchSize() (or Connection.setPrefetchSize() if you're using Oracle) - ResultSet row retrieval can be buffered to significantly improve performance and manage memory usage.

I'm assuming your database port is secured somehow, such as via a VPN tunnel. If it's not, if the port is open to the Internet, it will be found by hackers and attacked; if there's any security errors in the database program, the hackers will get in.
I agree. Here's the link:
subject: JDBC: Minimum network bandwidth required
It's not a secret anymore!