oracle、proxool、hibernate使用总结

开始在myeclipse6.5中DB BROWER新建了一个数据库连接,如图:


一连接,报出了两个错误:
1. ORA-00604 error occurred at recursive SQL level string.

2.ORA-12705: invalid or unknown NLS parameter value.

 

查资料后解决(期间我还改过test用户的连接权限):

将MyEclipse中eclipse目录下的eclipse.ini文件,把Duser.language=en  改成 Duser.language=zh就行了.

 

proxool.xml放在SRC下,是这么写的:

<?xml version="1.0" encoding="UTF-8"?>
    <proxool-config>
    <proxool>
    <alias>DBPool</alias>
    <driver-url>jdbc:oracle:thin:@192.168.1.88:1521:XE</driver-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <driver-properties>
    <property name="user" value="test" />
    <property name="password" value="test" />
    </driver-properties>
    <house-keeping-sleep-time>90000</house-keeping-sleep-time>
    <maximum-new-connections>20</maximum-new-connections>
    <prototype-count>5</prototype-count>
    <maximum-connection-count>1000</maximum-connection-count>
    <minimum-connection-count>10</minimum-connection-count>
    </proxool>
    </proxool-config>

 applicationContext.xml中的sessionFactory:

 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="mappingResources">
           <!--数据字典的映射文件-->
            <list>
                 <!--测试实体映射文件-->
		<value>yang\model\testmapping\ListTest.hbm.xml</value>
		<!-- ................ -->
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
            <prop key="hibernate.proxool.xml">proxool.xml</prop>
  		<prop key="hibernate.proxool.pool_alias">DBPool</prop>
   		<prop key="connection.provider_class">
    		          org.hibernate.connection.ProxoolConnectionProvider
   		</prop>
                <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
                <prop key="show_sql">true</prop>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="hibernate.jdbc.batch_size">20</prop> 
            </props>
        </property>
    </bean>

 

 web.xml中还有配置,具体参考网上资料:

<!-- proxool提供的管理监控工具,可查看当前数据库连接情况。如果运行不成功,请删除本行 -->
   <servlet>
    <servlet-name>Admin</servlet-name>
<servlet-class>org.logicalcobwebs.proxool.admin.servlet.AdminServlet</servlet-class>
   </servlet>
   <servlet-mapping>
    <servlet-name>Admin</servlet-name>
    <url-pattern>/admin</url-pattern>
   </servlet-mapping>

 

 

附件中:

ojdbc14.jar是连接oracle数据库时用到的包,proxool-0.9.1.jar和proxool-cglib.jar是proxool连接池的包。

 

 

 

你可能感兴趣的:(eclipse,oracle,xml,Hibernate,servlet)