Linux (Centos) JDBC connects to Oracle at an ultra-slow speed problem

Source: Internet
Author: User
Recently, a Java Swing program was written under CentOS and found that the JDBC connection to Oracle in Linux was slow and often failed. But the same program runs very fast under Windows. Online search for a long time and I this situation is not okay, by chance to see the following article:
Original Address http://www.xuebuyuan.com/200181.html
Troubleshoot slow problems with JDBC Connection Orcale April 01, 2012 ⁄ general ⁄ a total of 341 characters ⁄ font size Small medium big ⁄ comments off using the Java Development Program, choose the Ojdbc14.jar driver, connect Oracle, the discovery speed is very slow. Write the test procedure, found that the light to establish the connection will need about 10s. The solution is not to be baffled. Later a colleague used Baidu Dafa to find the answer, the special record is as follows: We are using jdk1.5.0, for the lower version of the jdk1.4 or higher version of the jdk1.5.6 version, there is no problem. It should appear to be a JDK version issue. Later found that jdk.1.5.0 will default to find agents, spending a lot of time, so the code added: import java.net.ProxySelector; Proxyselector.setdefault (null), which masks the choice of proxy servers in jre1.5, using a direct connection. Re-test. Speed 0.4s. By the way despise Sun, own JDK, can not stabilize some, compatibility is better?

However, I am here are jdk1.8, at first did not take the matter, but later did not have a try to carry out the purpose of testing a bit.

mygod! The problem is solved! Keep track of your notes, and treat the same depressed classmates.

Linux (Centos) JDBC connects to Oracle at an ultra-slow speed problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.