I followed the steps below to successfully connect to an SQLExpress instance using JDBC:
- Configure TCP/IP communication with SQL Express
- Open SQL Server Configuration Manager.
- Go to SQL Server Network Configuration -> Protocols for SQLEXPRESS
- Set the status of TCP/IP protocol to "Enabled" (if it is already not).
- Open Properties window for TCP/IP, go to IP Addresses section.
- Go to the bottom of this property page and set the TCP Port under
IPAll
to 1433.
- Connect to the SQLExpress instance using
Microsoft's JDBC driver for SQL Server
- JDBC URL:
jdbc:sqlserver://localhost;instance=SQLEXPRESS;databaseName=<your DB>;user=<your User>;password=<your Passwd>