jdbc drivers and specs for SQL Server
satya - 8/30/2020, 4:32:55 PM
SQL Server JDBC drivers downloads
SQL Server JDBC drivers downloads
satya - 8/30/2020, 4:33:30 PM
Microsoft docs on JDBC drivers are here
satya - 8/30/2020, 4:33:43 PM
These are 2020 notes. fyi
These are 2020 notes. fyi
satya - 8/30/2020, 5:01:04 PM
You can search for Microsoft drivers in maven here
satya - 8/30/2020, 5:01:38 PM
Here is a direct link to maven centrol jdbc sql server drivers
Here is a direct link to maven centrol jdbc sql server drivers
satya - 8/30/2020, 5:15:46 PM
what was I using before?
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
satya - 8/30/2020, 5:16:43 PM
MS SQL server JDBC connection string
MS SQL server JDBC connection string
satya - 8/30/2020, 5:18:25 PM
See if this microsoft article helps
satya - 8/30/2020, 5:20:39 PM
what is the MS SQL Server instance name?
what is the MS SQL Server instance name?
satya - 8/30/2020, 6:00:25 PM
Apparently
//This gives server
select @@servername
//This gives instancename
select @@servicename
satya - 8/30/2020, 6:01:18 PM
How to find MS SQL Server instance name from SSMS?
How to find MS SQL Server instance name from SSMS?
Search for: How to find MS SQL Server instance name from SSMS?
satya - 8/30/2020, 6:03:35 PM
Here is how to use SQL Server configuration manager to find these
Here is how to use SQL Server configuration manager to find these
satya - 8/30/2020, 6:08:18 PM
The default instance names
//They could be
SQLEXPRESS
or
MSSQLSERVER
satya - 8/30/2020, 6:31:20 PM
Here is what the config manager looks like
satya - 8/30/2020, 6:31:50 PM
Notice the server instance name inside the brackets of SQLServer(....)
Notice the server instance name inside the brackets of SQLServer(....)
satya - 8/30/2020, 6:32:49 PM
Here is what you see for logon in the config manager
Again that instance name shows up as a service
satya - 8/30/2020, 6:33:19 PM
Host and instance is in this tab
satya - 8/30/2020, 6:42:33 PM
The latest release (2020) of JDBC Driver: 8.4
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.
satya - 8/30/2020, 6:44:08 PM
Connection string
//Fore SQL Server Express
jdbc:sqlserver://localhost\\sqlexpress;database=dbname
//For SQL Server
jdbc:sqlserver://localhost\\MSSQLServer;database=dbname
satya - 8/30/2020, 6:45:07 PM
The double quotes
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
satya - 8/31/2020, 8:23:58 AM
Some problems connecting
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
satya - 8/31/2020, 8:24:03 AM
The server mssqlserver is not configured to listen with TCP/IP
The server mssqlserver is not configured to listen with TCP/IP
Search for: The server mssqlserver is not configured to listen with TCP/IP
satya - 8/31/2020, 8:26:19 AM
SQL Server 2019 Configuration Manager: that is the name
You will need a portion of that name at least to invoke it from windows search box
satya - 8/31/2020, 10:17:27 AM
Fix: Use configuration manager to enable tcp/ip
Fix: Use configuration manager to enable tcp/ip
satya - 8/31/2020, 10:17:49 AM
By the way Browser service should be running as well
By the way Browser service should be running as well
satya - 8/31/2020, 10:18:45 AM
Here is the network configuration in sql configuration manager
satya - 8/31/2020, 10:21:47 AM
In summary some of the things you will run into
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