WINXP SP2+ROSE 2003的”MEM_BAD_POINTER”的解决办法

——今天不得不重拾多年没用的“肉丝”,退出的时候还是弹出那个该死的“MEM_BAD_POINTER”
的提示框。千错万错就是因为SP2跟某些软件比较低版本的shw32.dll冲突有关。替换掉
相应应用程序的这个dll就是了。

解决办法:

1) extract shw32.dll from the attached zip file.

2) locate the copy of shw32.dll that the affected program (the one
that’s giving the MEM_BAD_POINTER error) is using. Rename this file,
or move it to some other directory for safe keeping. Note: this step
is not strictly necessary, BUT if you experience problems with our
new DLL, the first thing we’re going to suggest is that you revert to
your old one.

3) with your old shw32.dll renamed or moved for safe keeping, install
the new shw32.dll where the old one used to be. Now run your app as
usual and verify that the error no longer appears.

4) if after step 3 you still see the MEM_BAD_POINTER error, search
your hard drives for any other occurrences of shw32.dll and replace
those (using the above procedures), one at a time, until the error no
longer appears.

Oracle JDBC驱动中对Date支持的改动

——一直我们在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

Eclipse的resource视图去除CVS目录显示的方法

当项目文件是从CVS checkout出来的时候,用eclipse打开就会在视图里
面出现CVS的目录,甚是碍眼。

虽然在eclipse的resource视图里面有Filter可以屏蔽某些无用的目录,
但是里面固化了一些pattern,但是没有也不能增加CVS相关的pattern。

通过Number5同志的努力寻找终于找到解决之道:(适用于Eclipse 3.0.x)

1)关闭eclipse进程;
2)打开eclipse下面的plugins\org.eclipse.jdt.ui_3.0.2
\plugin.xml (其中3.0.2根据你自己eclipse的3.0.x版本修改啦,你
应该没有这么笨的)
3)编辑文件,找到以下一段:

<extension
point=”org.eclipse.ui.ide.resourceFilters”>
<filter
selected=”false”
pattern=”*.class”>
</filter>
</extension>

在下面增加如下一段:

<extension
point=”org.eclipse.ui.ide.resourceFilters”>
<filter
selected=”false”
pattern=”CVS*”>
</filter>
</extension>

保存文件。
4)在命令行运行eclipse -clean,切记一定要加入参数,否则无法清除
原来启动的配置cache的!然后在resource视图中修改Filter,你就看到
CVS*的选项了。

注:如果在eclipse 2.x下面改动,也是类似,只是那段xml有点不同:
\plugins\org.eclipse.ui_2.0.1\plugin.xml

<extension
point=”org.eclipse.ui.resourceFilters”>
<filter
selected=”false”
pattern=”CVS*”>
</filter>
</extension>

但我没有eclispe2的版本,没有证实。

在P4机器上面打Oracle8.1.7.4Patch的问题

——最近要搞Oracle10g的数据库,但是本身有些项目是放在8.1.7上面的,因此本机的
客户端只好装个8.1.7.4的补丁,然后两边都可以连。但是在安装的时候点击setup居然
没有反应。原来是Oracle用的jre118跟P4 CPU的兼容问题,在安装文件目录下面查找
*jit.dll文件,然后删除或者改名,就可以跑那个setup了。

——PS:之后改装Oracle10g的客户端,竟然在分析相关性检查的时候,抛出一个“无
法确定主机IP”的错误,百思不得其解。于是将本机IP由DHCP获得改成自己输入的固
定IP,结果当然是成功啦。我分特,装了大半个下午的Oracle。