There's a lot of problems with SQL Server connections. Do not set the true connection is not on, here small remember! (Some of the information from the Internet)
Problems with JDBC Connection MySQL
(example with JDBC2005 Drive, in the Lib folder, right click on build path--->add-build path)
Run connectionSqlServer2005 package under the Javaconnectionsql class can!
1. Driver issues :
JDBC2005 and JDBC2008 must be the same, otherwise it will be an error! (I'm using 2008)
2. Service startup problem :
In fact, many cases are not connected, because your service did not start!
Run-----> Enter services.msc-----Find the Services for SQL Server and start on the line.
If not, all the services about SQL Server are started!
3. Login account and password problem
problem root : Many people are not set up when they are installed and log on only with Windows authentication.
3.1 Setting the password
After login: New query connection, enter:exec sp_password null, ' sa ', ' sa '--Change the sa password to SA, the previous one is the password, and the next is the username.
3.2 Setting up SQL Server Authentication logon (failure to set the error of SQL Server user ' sa ' Login failed )
1. Open the database-log on to the database with Windows identity
2. Login Name--double-click SA (open attribute)
3,
General--Set password--ok (as described earlier, here is the visual setting)
4, status-Login: Enable--Determine
5, Right click Server Name--Properties
6, Security--Select SQL Server and Windows authentication Mode--Determine
7. Right-click server name--reboot--Close database connection, exit program--Log in to database with SA
4. All Ok,eclipse under the success of the connection.
Execution results: