weblogic hibernate关于No Dialect mapping for JDBC type
[url] http://www.50xiao.com weblogic hibernate关于No Dialect mapping for JDBC type :-9 hibernate执行原生sql语句问题(50校招生网)[/url]
最近碰到一个这样的问题,在tomcat,webspher下执行都是正常的,然后换到weblogic 下就出现问题,解决办法:
新建一个类,如下:
public class OracleCustomDialect extends org.hibernate.dialect.Oracle10gDialect {
public OracleCustomDialect() {
// log.info( "Using dialect: " + this );
// sqlFunctions.putAll( STANDARD_AGGREGATE_FUNCTIONS );
super();
registerHibernateType(1, "string");
registerHibernateType(-9, "string");
registerHibernateType(-16, "string");
registerHibernateType(3, "double");
registerHibernateType(Types.CHAR, Hibernate.STRING.getName());
registerHibernateType(Types.NVARCHAR, Hibernate.STRING.getName());
registerHibernateType(Types.LONGNVARCHAR, Hibernate.STRING.getName());
registerHibernateType(Types.DECIMAL, Hibernate.DOUBLE.getName());
// registerHibernateType( Types.s, Hibernate.STRING.getName() );
}
}
50校招生网(http://www.50xiao.com)
然后让OracleCustomDialect 替换org.hibernate.dialect.Oracle10gDialect ,就OK了