测试环境正常的程序,到生产出如下错误
java.sql.SQLException: 不能在 UTF8 和 UCS2 之间转换: failUTF8Conv
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
后来发现是oracle驱动的事,使用ojdbc14.jar解决问题。class12.jar和ojdbc14.jar有何区别。
class12.jar用于JDK1.2,1.3中,虽然在1.4,1.5中使用一般情况是没有问题的,但由于环境的变化可能出现未知的错误,这点本人深有体会。
ojdbc14.jar用于JDK1.4及其以上版本
另外二者和Oracle的版本也有关系。
在Oracle官方文档中说道:
JDBC Thin for All Platforms
classes12.jar (1,600,090 bytes) - for use with JDK 1.2 and JDK 1.3
classes12_g.jar (2,044,594 bytes) - same as classes12.jar, except that classes were compiled with "javac -g" and contain some tracing information.
classes12dms.jar (1,607,745 bytes) - same as classes12.jar, except that it contains additional code`to support Oracle Dynamic Monitoring Service.
classes12dms_g.jar (2,052,968 bytes) - same as classes12dms.jar except that classes were compiled with "javac -g" and contain some tracing information.
ojdbc14.jar (1,545,954 bytes) - classes for use with JDK 1.4 and 1.5
ojdbc14_g.jar (1,938,906 bytes) - same as ojdbc14.jar, except that classes were compiled with "javac -g" and contain some tracing information.
ojdbc14dms.jar (1,553,561 bytes) - same as ojdbc14.jar, except that it contains additional code`to support Oracle Dynamic Monitoring Service.
ojdbc14dms_g.jar (1,947,136 bytes) - same as ojdbc14dms.jar, except that classes were compiled with "javac -g" and contain some tracing information.
orai18n.jar (1,645,114 bytes) - NLS classes for use with JDK 1.2, 1.3, 1.4, and 1.5. This jar file replaces the old nls_charset jar/zip files.
ons.jar (48,492 bytes) - for use by the pure Java client-side Oracle Notification Services (ONS) deamon.
demo.tar (604,160 bytes) or demo.zip (529,267 bytes) - contains sample JDBC programs.