Oracle数据移植到PostgreSQL心得 (二)


程序使用柜架Spring + Hibernate 测试运行中出现Bug :

(1)、查询出错,在统计查询条数时如果SQL中出现Order by时出错
解决方案:将程序中的统计语句移到Order by 前面,先统计后查询,能提高查询速度。

(2)、Oralce库表中的CLOB配置成
org.springframework.orm.hibernate3.support.ClobStringType,在PostgreSQL中修改成string(能否有两者兼容)

(3)、ERROR: operator does not exist: character varying = integer
Oracle中支持类型自动转换,在PostgreSQL中出错。
解决方案:一个个修改,加上单引号,相当的麻烦
如:
sql.append(" and u.importDistruted = " + patentImportInfo.getImportDistruted());
修改成
sql.append(" and u.importDistruted = '" + patentImportInfo.getImportDistruted() + "'");

你可能感兴趣的:(spring,oracle,sql,Hibernate,PostgreSQL)