The Java connection sqlserver2008 driver package Is for you to collect the driver software on the Java, download to allow users to better use SqlServer2008 after installation data base And to meet the needs of users, to green resources network to download it!
The Java connection sqlserver2008 driver package:
Java connection SQL Server 2008 to jar, which has 4 jar packet is 3 SQL Server 2008 The driver package there is a connection using the package.
How to use Java to connect SqlServer2008 database?
Decompression is completed, you must enter < extract to the directory >\sqljdbc_3.0\chs, there is a thing we need
One is sqljdbc.jar, another is sqljdbc4.jar
This is the use of sqljdbc4.jar
First configure SA authentication:
Due to the installation of sqlServer2008 is to install the windows authentication, and did not add sqlServer identity of the user is sqlServer2008, so we add user:
Open the Microsoft SQL Server Managerment Studio and the windows authentication login, on the left side of the object Explorer - > Security > login name, right-click the sa-> attribute, add a password for the SA user, Choice SqlServer authentication, in the "state" option granted to connect to the database and log. Right click enable the root node object explorer, select properties - Safety of ->sqlServer and windows authentication mode, so as to create a SQL Server 2008 SQL server authentication user sa.
Connect to the sqlserver2008 database in the Java code in two ways, one is the SA authentication mode, the other one is mixed authentication mode:
Second: hybrid authentication mode, using the above java code url2.
Need the following operation in integrated mode:
Find you just unzip: enter the sqljdbc_3.0\chs\auth\x64, I was 64, if it is 32 x86, a file named sqljdbc_auth.dll to copy: C:\Windows\System32, good
The last is used by the sqlserver2008 dynamic port, you need to configure it:
Open the configuration tool for ->SQLServer configuration manager ->SQLServer network configuration ->MSSQLSERVER protocol ->TCP/IP is enabled, the TCP dynamic port in 0 are deleted, and then put a blank; pulled to the bottom of the list (IPALL), equipped with a fixed port, after you connect to the database using this port can be as follows: Map
I used here is 1368, the database after the restart, can be connected with the above procedure.