Default port in SQL Server
2 answers
Hi! I have a similar problem, in my case, I don't want to specify any port in the 'database.properties' file 'db.server.port=' line, since I want to connect to my database that is in the sqlDBReal server. If I delete the indicated line it gives me an error, how can I specify that I do not want any port?
thanks :)
Hello.
If you don't configure the port in "setup/database.properties" file, it will be left empty in the jdbc url given to the engine. This might not work...
- Platform setup (e.g. doing setup.sh pull) uses spring to configure datasource using properties files `database.properties` and `internal.properties` -> spring might do some clever things here
- Platform setup then configure tomcat, it update the `bonita.xml` file with the properties given in the same `database.properties` and `internal.properties` file.
- When no port is specified, the driver uses the default port 1433: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url
- There is a note in the documentation that says that the driver might also get the port number: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url
For optimal connection performance, you should set the portNumber when you connect to a named instance. This will avoid a round trip to the server to determine the port number. If both a portNumber and instanceName are used, the portNumber will take precedence and the instanceName will be ignored.
In any case, the port needs to be specified to work properly.
What is the use case exactly?
HTH.
Comments
Hi! I have a similar problem, in my case, I don't want to specify any port in the 'database.properties' file 'db.server.port=' line, since I want to connect to my database that is in the sqlDBReal server. If I delete the indicated line it gives me an error, how can I specify that I do not want any port?
thanks :)
Comments
To clarify this a little further, here we are talking about the default port for connecting to the database. So, if no port is specified for SQL Server connection, will a default port be used instead?