Description
Driver version
9.4.0.jre16
SQL Server version
Microsoft SQL Server 2019 (RTM-GDR) (KB4583458) - 15.0.2080.9 (X64) Nov 6 2020 16:50:01 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit)
Client Operating System
Windows 10 Pro 10.0 (Build 19041: )
JAVA/JVM version
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-39)
OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)
Table schema
Cities table from WideWorldImporters sample database
Problem description
- Expected behaviour:
I expect resultSet.getObject and statement.setObject to work with geometry types.
- Actual behaviour:
class [B cannot be cast to class com.microsoft.sqlserver.jdbc.Geometry ([B is in module java.base of loader 'bootstrap'; com.microsoft.sqlserver.jdbc.Geometry is in unnamed module of loader 'app')
- Error message/stack trace:
see 2.
- Any other details that can be helpful:
I used the sample from here:
https://docs.microsoft.com/en-us/sql/connect/jdbc/spatial-data-types-sample?view=sql-server-ver15
And modified it slightly to use Statement and ResultSet instead of SQLServerPreparedStatement and SQLServerResultSet
and used setObject and getObject instead of setGeometry and getGeometry.
JDBC trace logs
N/A
Reproduction code
See the sample link
Metadata
Metadata
Assignees
Labels
Type
Projects
Status