OC4J升级Oracle JDBC driver版本
DB升级到11g,application server是10133,必须升级OJDBC driver版本
- 备份$OC4J_HOME/j2ee/home/config下的system-application.xml和server.xml
- 在$OC4J_HOME/j2ee/home/shared-lib下新建目录oracle.jdbc/11.1.0.7.0,如果是application server版本还可以在instance的根目录创建shared-lib目录,这个shared-lib就只会对该Instance起作用。
- 接着将ojdbc5.jar, ojdbc5dms.jar 和 orai18n.jar复制到2中创建的目录下
- 修改server.xml,添加:
<shared-library name="oracle.jdbc" version="11.1.0.7.0">
<code-source path="ojdbc5.jar"/>
<code-source path="ojdbc5dms.jar"/>
<code-source path="orai18n.jar"/>
</shared-library>
|
5修改system-application.xml将
<import-shared-library name="oracle.jdbc" />
|
改成
<import-shared-library name="oracle.jdbc" min-version="11.1.0.7.0"/>
|
6确认修改
· 通过EM登录上去,打开administration页面,进入shared-lib项,发现oracle.jdbc11.1.0.7.0成功加入,而且该OC4J下的application也都使用了该shared-lib
· 通过drvtest程序检测ojdbc的版本,部署drvtest.ear到server上。打开
http://host:port/drvtest/dbdetails.jsp,输入jdbc diriver url,用户名,密码,提交后输出:
10.1.3 jdbc check jsp
JDBC Driver details
=============
JDBC Driver Name is ........ Oracle JDBC driver
JDBC Driver Version is ..... 11.1.0.7.0-Production
JDBC Driver Major Version is 11
JDBC Driver Minor Version is 1
=============
Database Details
=============
Database Product Name is ... Oracle
Database Product Version is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
|
一切都很顺利。Goodbye。
7 为何配置文件需要如此修改,可参考OC4J developer guide。简单地说就是改变了system.root classloader的classpath。.
8 drvtest下载:见附件,请将后缀名改成ear