org.hibernate.MappingException:没有JDBC类型的方言映射:-9

问题描述:

当我尝试从SQLServer2008中的表中获取记录时,出现了一个名为org.hibernate.MappingException的异常:没有JDBC类型的方言映射:-9为什么?

When I am trying to fetch the record from a table in SQLServer2008 am getting the exception called: org.hibernate.MappingException :No Dialect mapping for JDBC type: -9 why?

尽管配置文件正确.

我更改了查询并将其显式转换为varchar并成功运行.

I changed the query and explicitly cast it to varchar and it worked.......

String myquery = "select cast(t2.name as varchar) column_name from sys.objects t1 inner join sys.columns t2 on t2.object_id = t1.object_id"+
" left join sys.indexes t3 on t3.object_id = t1.object_id and t3.is_unique = 1 left join sys.index_columns t4 on t4.object_id = t1.object_id and t4.index_id = t3.index_id and t4.column_id = t2.column_id where (upper(t1.type) = 'U' or upper(t1.type) = 'V') and upper(schema_name(t1.schema_id)) = 'dbo' and upper(t1.name) = 'TEST'";