How to Connect to Locally Installed SQL Server Express with JDBC

Once you install SQL Server Express locally, you need to go through a few configuration steps to connect to the server with JDBC.

Tools

In this demo, I am using SQL Workbench to connect to the server. SQL Server Express is 2017 version. JDBC is 7.1.x from Maven Repo.

Steps

(1) Enable TCP/IP Protocol

Go to Sql Server Configuration Manager (usually located in C:\\Windows\SysWOW64) and enable TCP protocol if it is not enabled. Once you enable it, you need to restart the server.

(2) Check if the port number is set

From the TCP/IP Properties above, go to the IP Address tab and scroll down to the bottom. Make sure the server is not using dynamic port. If it is, the port number is set to 0. It is usually set to 52188. The default port number for SQL Server Express is different from the default port for SQL Server, which is 1433. You can either set it to 1433 or keep it as 52188. If this is set to 52188, make sure to add port number in the JDBC connection string.

(3) Create user with password

You need to make sure SQL server enables password login. With integratedSecurity=true, you may get the error: the driver is not configured for integrated authentication. To enable user login with SQL Server Express, refer to the previous post How to Enable User Login with SQL Server Express.

(4) Configure JDBC connection string

In this example, the url string is jdbc:sqlserver://localhost\SQLEXPRESS:52188; You can add username and password in the string. In this case, those values are defined in the boxes below. Here is the reference for SQL Server JDBC connection string.

Git
How to specify which Node version to use in Github Actions

When you want to specify which Node version to use in your Github Actions, you can use actions/setup-node@v2. The alternative way is to use a node container. When you try to use a publicly available node container like runs-on: node:alpine-xx, the pipeline gets stuck in a queue. runs-on is not …

AWS
Using semantic-release with AWS CodePipeline and CodeBuild

Here is the usual pattern of getting the source from a git repository in AWS CodePipeline. In the pipeline, we use AWS CodeStart to connect to a repo and get the source. Then, we pass it to the other stages, like deploy or publish. For some unknown reasons, CodePipeline downloads …

DBA
mysqldump Error: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)

mysqldump 8 enabled a new flag called columm-statistics by default. When you have MySQL client above 8 and try to run mysqldump on older MySQL versions, you will get the error below. mysqldump: Couldn’t execute ‘SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM ‘$”number-of-buckets-specified”‘) FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = ‘myschema’ AND TABLE_NAME = ‘craue_config_setting’;’: Unknown …