参考了
http://blog.csdn.net/zhengyun_ustc/archive/2005/06/10/391542.aspx
http://www.xnovo.com/doc/html/aebbbgbgbbagaagimhcirpfj.html
还有IBM上面的一些教程,终于稍微尝试成功了。
注意,除了写代码之外,服务器那边也是要有一点设置才行的。
参考了
http://blog.csdn.net/zhengyun_ustc/archive/2005/06/10/391542.aspx
http://www.xnovo.com/doc/html/aebbbgbgbbagaagimhcirpfj.html
还有IBM上面的一些教程,终于稍微尝试成功了。
注意,除了写代码之外,服务器那边也是要有一点设置才行的。
——昨天晚上拉到今天早上,回到公司继续干活,因为这种肠胃问题在这种鬼天气下出
现已经是习以为常了。一打听,原来昨晚上Oracle的两个Support跟我们的同事一起都
做到了12点多,而且还病了一个,我们的PM晚上也跑去打点滴去了。一个这么重要的
项目就是靠一帮可敬的同事这样拼死拼活的撑着前进。
——晚上给项目组的同事介绍我们在产品组之前项目开发过程中用到的代码质量管理的
相关工具,幸而也引起了项目组同事的兴趣和共识。起码之前Falcon累死累活也是积累
了其中之一的经验,可以提供给其他同事共同进步,利己利人,好歹还是有一点点成就
感吧。
——今天又加班,明天也是,就这样又没有了一个周末。名曰培训,实际就是装机,继
续着当年在深圳那边的痛苦经历,闷绝地在一旁看和做,然后就是掉入出错-重装的轮
回。时间就是这样子消耗掉。原定是17:00可以走人,但是现在估计是无期了。原定今
晚和爸爸妈妈一起订了新兴的桌子吃端午节的饭,现在恐怕只能让老婆一个人陪他们两
老了。
——整个项目组的人都做的很累,其他同事昨天晚上还搞到很晚,有的还做到凌晨3点
了。大家仿佛都是凭着对公司的责任感在不懈的拼命,但是人始终不是机器的,这种状
态能够撑多久呢?从去年就一直持续的这样子忙,如果总是以这种工作状态下去的话,
在这样的公司工作也是无趣的。
——一直我们在Oracle8i上面用的程序,昨天发现放到9i数据库上面,用9i的JDBC驱动
连接后,发现我们用Java的Date类型放入到数据库DATE类型字段的数据,没有了时分
秒的信息。但是在8i上面用8i的JDBC驱动是没有问题的。换了一个我们自己Patch过的
8iJDBC驱动连9i数据库,DATE型的数据又可以保存时间信息了。结论就是9i的驱动是
不能将Java的Date里面的时间信息放入到DATE里面。
——翻查了Oracle的FAQ,果然发现这个结论和相应的解决办法:
Prior to 9.2, the Oracle JDBC drivers mapped the DATE SQL type to java.sql.Timestamp. This made a certain amount of sense because the Oracle DATE SQL type contains both date and time information as does java.sql.Timestamp. The more obvious mapping to java.sql.Date was somewhat problematic as java.sql.Date does not include time information. It was also the case that the RDBMS did not support the TIMESTAMP SQL type, so there was no problem with mapping DATE to Timestamp.
In 9.2 TIMESTAMP support was added to the RDBMS. The difference between DATE and TIMESTAMP is that TIMESTAMP includes nanoseconds and DATE does not. So, beginning in 9.2, DATE is mapped to Date and TIMESTAMP is mapped to Timestamp. Unfortunately if you were relying on DATE values to contain time information, there is a problem.
There are several ways to address this problem:
Alter your tables to use TIMESTAMP instead of DATE. This is probably rarely possible, but it is the best solution when it is.
Alter your application to use defineColumnType to define the columns as TIMESTAMP rather than DATE. There are problems with this because you really don’t want to use defineColumnType unless you have to (see What is defineColumnType and when should I use it?).
Alter you application to use getTimestamp rather than getObject. This is a good solution when possible, however many applications contain generic code that relies on getObject, so it isn’t always possible.
Set the V8Compatibility connection property. This tells the JDBC drivers to use the old mapping rather than the new one. You can set this flag either as a connection property or a system property. You set the connection property by adding it to the java.util.Properties object passed to DriverManager.getConnection or to OracleDataSource.setConnectionProperties. You set the system property by including a -D option in your java command line.
java -Doracle.jdbc.V8Compatibility=”true” MyApp
——无大成,无小成,多了一间要供20年的房子,和多了一个要供一辈子的老婆。光阴
似箭,个中感受回头理清楚了再慢慢写出来。