本站首页    管理页面    写新日志    退出


«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31


公告

戒除浮躁,读好书,交益友


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:邢红瑞的blog
日志总数:523
评论数量:1142
留言数量:0
访问次数:9692658
建立时间:2004年12月20日




[数据库]oracle8i数据库驱动TYPE_SCROLL_INSENSITIVE的bug
原创空间,  网上资源,  软件技术

邢红瑞 发表于 2005/4/20 10:02:29

这个问题很久以前也遇到过,东东也遇到了,oracle驱动的bug真多。Subject: prepareStatement return variance string value with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY prepareStatement return variance string value with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY When I use oracle jdbc driver whose version is 8.1.7.1.0,the PreparedStatement instance return different value of the same column 'yhry_checkfinter' which is defined in char(1). Here is my application: public static void main(String[] args) throws Exception { Class.forName("oracle.jdbc.OracleDriver"); Connection c = DriverManager.getConnection( "jdbc:oracle:thin:@10.1.7.177:1521:ora817", "user", "passt"); PreparedStatement ps = c.prepareStatement( "select yhry_checkfinter from yhyhry", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet res = ps.executeQuery(); System.err.println("DB:" + c.getMetaData().getDatabaseProductVersion()); System.err.println("Driver:" + c.getMetaData().getDriverVersion()); System.out.println("\nout with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY"); while (res.next()) { System.out.println("'" + res.getString("yhry_checkfinter") + "'"); } ps = c.prepareStatement("select yhry_checkfinter from yhyhry"); res = ps.executeQuery(); System.out.println("\nout without TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY:"); while (res.next()) { System.out.println("'" + res.getString("yhry_checkfinter") + "'"); System.err.println("'" + res.getString(1) + "'"); } c.close(); } The following is the output on console: DB:Oracle8i Release 8.1.7.4.1 - Production JServer Release 8.1.7.4.1 - Production Driver:8.1.7.1.0 out with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY 'Y ' 'Y ' 'Y ' 'Y ' 'Y ' 'Y ' 'N ' 'N ' 'Y ' 'Y ' 'N ' 'N ' 'N ' 'N ' out without TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY: 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'Y' 'N' 'N' 'N' 'N' 'Y' 'Y' 'Y' 'Y' 'N' 'N' 'N' 'N' 'N' 'N' 'N' 'N' The value of yhry_checkfinter is always with two blank paddings ,when I execute the sql with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY,but it's type is char(1). The value of yhry_checkfinter is correct,executing the sql without TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY. Is this a bug of jdbc drive 8.1.7.1.0?If not,what happens.好在metalink的专家,给出了解答prepareStatement return variance string value with TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY You're probably hitting Bug:1361738 - JDBC thin oracle.sql.CHAR may have too much blank padding with ScrollableResultSets Symptoms: If the String returned by ScrollableResultSet.getString() is padded with extra blanks and you are using the thin driver, you have likely encountered this bug. oracle.sql.CHAR values returned by ScrollableResultSets may be padded up to 3 times their correct length with blanks when using the thin driver. The fix is available in Releases 8173,9010  


阅读全文(5639) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.680 second(s), page refreshed 144763665 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号