概述
We are using the ojdbc14.jar driver to talk to a 10.1.0.4 version database. When calling getObject() on a rowset, asking for a column that has database type TIMESTAMP(9), I expect to get a java.sql.Timestamp. Instead, I get an oracle.sql.TIMESTAMP, which cannot be casted to java.sql.Timestamp.
Reading the Oracle forums and manuals, I get the impression that the default mapping should be to the java.sql.* types - if possible - and that mapping to oracle.sql.* types is optional.
Can anyone shed some light on this? What is the default mapping and how can it be influenced? Any help would be greatly appreciated.
ava.util.Properties prop = new java.util.Properties ();
prop.put ("oracle.jdbc.V8Compatible", "true"); // so getObject returns Timestamp!
prop.put ("user", "scott");
prop.put ("password", "tiger");
String url ="jdbc:oracle:thin:@host:port:sid";
Connection conn = DriverManager.getConnection (url,prop);
最后
以上就是玩命翅膀为你收集整理的oracle.jdbc.V8Compatible的全部内容,希望文章能够帮你解决oracle.jdbc.V8Compatible所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复