MyBatis SQL Server Error execution
com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is not supported.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.TypeInfo$Builder$16.apply(dtv.java:1996) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.TypeInfo$Builder.build(dtv.java:2158) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.TypeInfo.getInstance(dtv.java:2221) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.StreamColumns.setFromTDS(StreamColumns.java:46) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerResultSet$1CursorInitializer.onColMetaData(SQLServerResultSet.java:217) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:77) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.<init>(SQLServerResultSet.java:311) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1526) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) ~[sqljdbc4-4.0.jar:na]
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) ~[sqljdbc4-4.0.jar:na]
The reason is: SQL Server's JDBC flaw, need to cast
Before modification:
ISNULL (ep.[ Value], ') as Columndescribe
After modification:
CONVERT (varchar), ISNULL (ep.[ Value], ') as Columndescribe
Cause:com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is not supported.