windows 2000 server + tomcat5 + hibernate2.1.2
server.xml:
<Context path="/quickstart" docBase="quickstart">
<Resource name="jdbc/quickstart" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/quickstart">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://192.168.0.42:3306/fee_for_game</value>
</parameter>
<parameter>
<name>driverClassName</name><value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>bgame</value>
</parameter>
<parameter>
<name>password</name>
<value>123456</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
</ResourceParams>
</Context>
web.xml:
<resource-ref>
<res-ref-name>jdbc/quickstart</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
hibernate.cfg.xml:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/quickstart</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<mapping resource="hibernatetest/Deadline.hbm.xml"/>
</session-factory>
</hibernate-configuration>
but,when I run my program,there is an exception:
19:42:56,984 WARN SettingsFactory:95 - Could not obtain connection metadata
java.sql.SQLException: Cannot load JDBC driver class 'null'
why?
|