Java connection to SQL Server pits (Rookie Pro test)

Source: Internet
Author: User

As a rookie, when you first started using Java to connect to SQL Server, it took a short time,

Can be said to solve one after another, so I think it is necessary to share my experience to everyone.

(because I stepped on most of the pits)

First pit : Load drive. Java to connect to the database need to drive, we go online to download a

Sqljdbc.jar on the line. What to do when you download it.

At this point, we add a file to the project, then paste the package in, and then right-click the package

Add the build path so you can. At this time you think it's done, but there's a lot of holes in the back.

Second pit:"Failed to load the Sqljdbc_auth.dll", for this we just need to download

Sqljdbc_auth.dll This file on the line, but I got down one, found inside all kinds of hooligans,

So I went to the csdn under a, or relatively useful. When you're done downloading, you'll assign him to the C drive under Windows.

Directory is on the line.

You think it's settled, but not yet.

The third pit : The way the database is validated, as a rookie, may just start installing SQL Server

No attention is paid to the authentication method. But when it comes to Java connectivity, it has an impact.

I'm the rookie, just at the beginning, I chose Windows authentication, but it was displayed when I connected.

"The login is from an untrusted domain and cannot be used with Windows Authentication"

I Baidu a bit, find a lot, online have the same question questions, some people replied that "verification method mixed"

Read this, the verification method mixed I understand, but how to solve it. There seems to be few answers online.

I summed up the method: The first step with Windows authentication after entering,

Right click on properties

Switch the authentication mode to the one below .

And then

Select the SA user name in the login name, and then modify the password.

Next is the fourth pit , change the password after re-login, the password is right but is not logged .

I tried it over and over and finally solved it.

Right-click and select Restart , and then you are ready to start.

Freshman dog Beginner, not please forgive me.

Java connection to SQL Server pits (Rookie Pro test)

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.