Port number should normally be 1433 for MSSQL, but often, this may not even be specified, so to do that you would need to:
- Open Microsoft SQL Configuration Manager
- Find 'SQL Server Network Configuration' on the left pane and expand it
- Select 'Protocols for
- Right-click TPC/IP on the right and select properties
- Make sure Enabled and Listen All have Yes chosen in the Protocol tab
- Select the IP Addresses tab and scroll to the end where IPAll is.
- Type in 1433 in TCP Dynamic Ports and leave TCP Port empty
- Click OK then select SQL Server Services on the left pane
- Right-click on 'SQL Server (YOU SERVER NAME)' and click Restart
The instance name is not necessary, it can be left blank.
Now for Username:
Note that what comes after // (jdbc:sqlserver://) is usually the host
and not your username.
- Open Microsoft SQL Server Management Studio
- Right-click on the server and click properties
- Go to Security and choose 'SQL Server and Windows Authentication mode'
- You will get a warning asking you to restart your server. Ignore this for now and go back into Microsoft SQL Server Management Studio
- Expand 'Security' then expand 'Logins'
- You will find the default user called 'sa', right-click on it and select Properties
- In General you can enter a password of your choice, enter the same password in Confirm Password
- Click 'Status' on the left and make sure Login is 'Enabled' then OK everything!
Go back into NetBeans and try to connect again. This time using Port 1433, nothing for Instance Name, username as 'sa' and password . Test the connection to ensure you get no errors. Good luck.