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)