Hallo,
for testing hibernate I've written a little test program, keeping an eye on the Hibernate & Tomcat Quickstart document.
But when executing I get the following error:
1031 [http8080-Processor2] INFO impl.SessionFactoryImpl - Use outer join fetching: false
1031 [http8080-Processor2] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
1031 [http8080-Processor2] ERROR util.JDBCExceptionReporter - Cannot create JDBC driver of class '' for connect URL 'null'
1047 [http8080-Processor2] WARN impl.SessionFactoryImpl - Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:60)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:160)
I configured the database (MSSQL2000) in the server.xml:
<Context path="/demo" docBase="demo">
<Resource name="jdbc/demo" scope="Shareable" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/demo">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:microsoft:sqlserver://ASTERIX:1433;DatabaseName=Diplom</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value>xxx</value>
</parameter>
To resolve a JNDI-Problem I inserted the following passage in the web.xml:
<resource-ref>
<res-ref-name>jdbc/demo</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
I use WSAD5.01, Tomcat 4.1.29, MSSQL 2000
I hope someone can help me.
Thanks,
Stephan
|