JDBC Connection SQL Server database problem analysis _mssql

Source: Internet
Author: User

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:

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.