org.hibernate.MappingException:没有JDBC类型的方言映射:-9 [英] org.hibernate.MappingException :No Dialect mapping for JDBC type: -9

查看:100
本文介绍了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'"; 

这篇关于org.hibernate.MappingException:没有JDBC类型的方言映射:-9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆