jdbc drivers and specs for SQL Server

SQL Server JDBC drivers downloads

Search for: SQL Server JDBC drivers downloads

Microsoft docs on JDBC drivers are here

These are 2020 notes. fyi

You can search for Microsoft drivers in maven here

Here is a direct link to maven centrol jdbc sql server drivers

1. sqljdbc4.jar

2. It was not required for compile

3. It is only a run time dependency

4. It was kept in web-inf/lib directory of akc

MS SQL server JDBC connection string

Search for: MS SQL server JDBC connection string

See if this microsoft article helps

what is the MS SQL Server instance name?

Search for: what is the MS SQL Server instance name?

How to use T-SQL to do this


//This gives server
select @@servername

//This gives instancename
select @@servicename

How to find MS SQL Server instance name from SSMS?

Search for: How to find MS SQL Server instance name from SSMS?

Here is how to use SQL Server configuration manager to find these


//They could be

SQLEXPRESS

or

MSSQLSERVER

Notice the server instance name inside the brackets of SQLServer(....)

Again that instance name shows up as a service

The Microsoft JDBC Driver 8.4 for SQL Server provides mssql-jdbc-8.4.1.jre8.jar, mssql-jdbc-8.4.1.jre11.jar, and mssql-jdbc-8.4.1.jre14.jar class library files.


//Fore SQL Server Express
jdbc:sqlserver://localhost\\sqlexpress;database=dbname

//For SQL Server
jdbc:sqlserver://localhost\\MSSQLServer;database=dbname

Are not needed if you are not using it in a string or in a properties file. FYI. The original spec is a SINGLE "/" FYI

1. Jar file path is wrong

2. Same driver name will work as the older versions. However I do see some deprecated methods for creating driver instances.

3. Instance name is wrong in my connection string. It was pointing to SQLEXPRESS

4. Now I see The server mssqlserver is not configured to listen with TCP/IP in the log file

The server mssqlserver is not configured to listen with TCP/IP

Search for: The server mssqlserver is not configured to listen with TCP/IP

You will need a portion of that name at least to invoke it from windows search box

Fix: Use configuration manager to enable tcp/ip

By the way Browser service should be running as well

1. Correct Jar file in the class path

2. Browser service running

3. Correct connection string with the database instance name

4. Correct userid/password

5. Tcip/ip and port enabled, that you can check through configuration manager