[求助] 请我帮我看看在Tomcat4.1.31下配置数据源出错的问题

06-11-08 zhangbo198294
conf/server.xml:

<Context path="" docBase="ROOT" debug="0">

<Resource name="jdbc/oracle" auth="Container" type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/oracle">

<parameter>

<name>factory</name>

<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>

</parameter>

<parameter>

<name>driverClassName</name>

<value>oracle.jdbc.driver.OracleDriver</value>

</parameter>

<parameter>

<name>url</name>

<value>jdbc:oracle:thin:@10.16.102.232:1521:tyhb</value>

</parameter>

<parameter>

<name>username</name>

<value>edu</value>

</parameter>

<parameter>

<name>password</name>

<value>edu</value>

</parameter>

<parameter>

<name>maxActive</name>

<value>20</value>

</parameter>

<parameter>

<name>maxIdle</name>

<value>10</value>

</parameter>

<parameter>

<name>maxWait</name>

<value>-1</value>

</parameter>

</ResourceParams>

</Context>

WEB-INF/web.xml

<resource-ref>

<res-ref-name>jdbc/oracle</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

<res-sharing-scope>Shareable</res-sharing-scope>

</resource-ref>

hibernate.cfg.xml:

<property name="connection.datasource">java:comp/env/jdbc/oracle</property>

<property name="show_sql">true</property>

<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>

我已经把Oracle的驱动放到common/lib目录里了 但一连接数据就抱错了:

net.sf.hibernate.JDBCException: Cannot open connection

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver

哪位朋友知道解决吗?麻烦请告诉我谢谢

zhangbo198294
2006-11-08 15:14

conf/server.xml:
<Context path="" docBase="ROOT" debug="0">
<Resource name="jdbc/oracle" auth="Container" type="javax.sql.DataSource"/> 
<ResourceParams name="jdbc/oracle">             
<parameter>                    
<name>factory</name>                
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>         
</parameter>             
<parameter>                    
<name>driverClassName</name>                
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>             
<parameter>                    
<name>url</name>                
<value>jdbc:oracle:thin:@10.16.102.232:1521:tyhb</value>         
</parameter>         
<parameter>                    
<name>username</name>                
<value>edu</value>         
</parameter>             
<parameter>                    
<name>password</name>                
<value>edu</value>     
</parameter>             
<parameter>                    
<name>maxActive</name>                
<value>20</value>         
</parameter>             
<parameter>                    
<name>maxIdle</name>                
<value>10</value>         
</parameter>             
<parameter>                   
<name>maxWait</name>   
<value>-1</value>             
</parameter>           
</ResourceParams>
  </Context>

WEB-INF/web.xml
<resource-ref>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>

hibernate.cfg.xml:
<property name="connection.datasource">java:comp/env/jdbc/oracle</property>
        <property name="show_sql">true</property>
        <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
我已经把Oracle的驱动放到common/lib目录里了 但一连接数据就抱错了:
net.sf.hibernate.JDBCException: Cannot open connection
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver
哪位朋友知道解决吗?麻烦请告诉我谢谢

<p>[code]
// 在此输入java代码
<p>

// 在此输入java代码
<p>
[/code]

zhangbo198294
2006-11-08 15:14
请大家帮帮我谢谢

zhangbo198294
2006-11-08 15:35
自己搞定了 path 和doBase 没指定应用目录......

xyf
2007-03-26 11:21
path和doBase的应用目录应该怎么指定阿,谢谢

猜你喜欢