Op 15-12-2021 om 01:39 schreef Russell Grew:
All,

I am not sure if this is best for the Dev or User list.

I recently discovered that in the web UI the “instance” field is at the bottom of the SQL Server data source page and not near the “host”, “port” or “database” fields. Prior to this discovery I was setting a static port, which is not ideal.

The underlying jdbc library doesn’t seem to understand “server\instance”.

I'm not sure what that means... do you mean the database driver? this requires a lookup that might need native code to interface with the OS

To my point – would it make sense to move the instance box up the page between host and port? I did try and find this in the code with a view to a pull request but could not see where this is located. Maybe the order of the fields in the GeoServer UI comes from Geotools or elsewhere?


that page is AFAIK dynamically generated using the parameters from the SQLServerDataStoreFactory

see https://github.com/geotools/geotools/blob/main/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDataStoreFactory.java

Since the parameters are a Map the order is (by contract of the Java API) undefined and may vary per JVM

Actually I may be wrong there; it is actually using a LinkedHashMap
in https://github.com/geotools/geotools/blob/7aafa5d3109b7323fde978c3271969a8bcf4bb1b/modules/library/jdbc/src/main/java/org/geotools/jdbc/JDBCDataStoreFactory.java#L422

So ordering is defined and should be preserved as insertion ordering in https://github.com/geotools/geotools/blob/7aafa5d3109b7323fde978c3271969a8bcf4bb1b/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDataStoreFactory.java#L133

However since you say it doesn't work I don't see why..

Also note that Microsoft actually recommends specifying the port for security reasons: Important: We recommend that the port number is always specified, as it's more secure than using SQLbrowser.

https://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver15

- M


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to