Configure SQL Server the "Express" connection to JDBC

Source: Internet
Author: User
Tags microsoft sql server microsoft sql server 2005 sql tomcat sql server express firewall

This paper mainly introduces the whole process of configuring SQL Server2005 Express and JDBC connection.

Can the Java application under SQL Server2000 be run on SQL Server Express, and tested and configured to summarize the following experiences:

1: First confirm that the SQL Server2005 Express has been installed.

2: Enable the TCP/IP protocol.

Open the TCP/IP protocol in the program->microsoft SQL Server 2005-> Configuration Tool->sql server perimeter configuration. As follows:

Figure 1-1 SQL Server Perimeter Application Configurator window

Select the perimeter application configurator for services and connections, as follows:

In remote connection, select Use both TCP/IP and Named pipes (B), and then click Apply.

3: Configure the TCP/IP protocol in SQL Server 2005

Under Program->microsoft SQL Server 2005-> Configuration tool, run SQL Server Configuration Manager, as follows:

Default TCP/IP properties, all listening for the value "Yes", as follows:

Modify TCP/IP properties to change all listening to "no"

Change the TCP dynamic port to Null (let the server choose its own port), and the TCP port to 1433

Recommendation: Then reboot the machine and allow the restart of the machine to start SQL Server Express. You can also restart the SQL Server2005 Express service.

4: The SQL Server database was configured successfully in Tomcat.

SQL Server 2005 express中url和driverClassName跟SQL Server 2000有不同:
url= jdbc:sqlserver://127.0.0.1:1433;DatabaseName=sqlserver2005_test(数据库名);
driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
 
  factory
  org.apache.catalina.users.MemoryUserDatabaseFactory
 
 
  pathname
  conf/tomcat-users.xml
 
 
 
 
  maxWait
  5000
 
 
  maxActive
  100
 
 
  password
  test
 
 
  url
jdbc:sqlserver://127.0.0.1:1433;DatabaseName=sqlserver2005_test;
 
 
  driverClassName
  com.microsoft.sqlserver.jdbc.SQLServerDriver
 
 
  maxIdle
  10
 
 
  username
  sa

5: For users using Skynet firewall

When the Java application is started, the following errors are returned when the Java database connection is established (part of the interception), as follows:

Cannot create PoolableConnectionFactory (接收 TDS 预登录响应时发生 I/O 错误。)
2007-03-05 14:56:35 ERROR [SYSTEM] Can not create a database connection!

In fact, this error does not matter, as long as the firewall is closed.



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.