JDBC connection to SQL Server database Problems and Solutions

Source: Internet
Author: User
Tags sql server driver

The two days have all been spent here. In fact, this is not a very complicated thing, but I have been engaged for a long time.

  • First, download the jdbc SQL Server Driver.
  • Then, test MSSQLServer. jar, msbase. jar, and msutil. Jar under tomcat/common/lib.
    A problem occurs here. Because jcreater is used. The three files are not set to the class library called by jcreater, so there is no prompt when using them.
  • The main reason for this time is that the system problem is not taken into account. my SQL Server is an earlier version. therefore, there is always a problem after installation. finally, the SP3 pudding is added. it's always done. this also draws some conclusions, and some of the information collected here is finally collected:
    1. When "Error establishing socket" appears, check whether SQL Server has SP3 pudding installed.

    2. Check whether SQL Server allows remote access. The procedure is as follows:
    1) Open "Enterprise Manager", open the console root directory> SQL Server group> Database
    2) Right-click the database and choose Properties"
    3) Select the "connection" tab and check whether the RPC service is selected under "remote server connection.

    3. Use the Telnet IP address 1433 to check whether the system prompts a connection error. If the system prompts an error
    Check whether the firewall shields the network access port of SQL Server or Java ide
    If yes, disable the firewall and restart SQL Server and Java IDE for testing,
    If the system still prompts the preceding error, perform the following steps:

    4. Check the SQL server port number and whether the TCP/IP protocol is enabled. The procedure is as follows:
    1) Open "Enterprise Manager", open the console root directory> SQL Server group> Database
    2) Right-click the database and choose Properties"
    3) Select the "General" tab and click "network configuration". If no "TCP/IP protocol" is enabled, add it
    4) Select "TCP/IP protocol" and click "properties" to check whether the port number is 1433.
    5) If the port number is 1433, change it to another port number, modify the JDBC connection statement, and change the port number to the newly enabled port number, such as JDBC: Microsoft: sqlserver: // SERVER_NAME: 1400 (assuming the new port number is 1400)

Related Article

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.