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.