First, download the installation
1. SQL Server Express Edition
Download: http://msdn.microsoft.com/vstudio/express/sql/download/
After installing the database, set up the ICP/IP protocol to start, as follows:
(1) Open SQL Server Configuration Manager
(2) Go to SQL Server network configuration->protocols for SQLEXPRESS
(3) Set TCP/IP to Enabled (enable)
(4) Double-click TCP/IP entry and go to IP addresses page
(5) TCP port is set to 1433 in IP all
(6) Restart service
2, SQL Server2005 database jsp JDBC Driver
Download: http://download.microsoft.com/download/1/c/a/1cae7cc0-c010-4e0c-b1b8-7915360ee0b9/sqljdbc_1.0.809.102_ Chs.exe
Install or extract the Sqljdbc.jar file, which is a JDBC-driven file. Put the Sqljdbc.jar on the classpath. (Web application placed under Web-inf/lib)
Second, connect the database SQL Server2005 Java code
1. Create test data table in tempdb
use tempdb
CREATE TABLE dbo.Table_1
(
ID bigint NOT NULL,
NAME varchar(20) NOT NULL,
EMAIL varchar(50) NULL
) ON [PRIMARY]