wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes tomcat hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "tomcat hibernate" Watch "tomcat hibernate" New topic
Author

tomcat hibernate

alec stewart stewart
Ranch Hand

Joined: Dec 23, 2003
Posts: 71
hi everyone
i am using the combination of tomcat5.5.4 hibernate 2.a and ms sql server 2000
i have placed jsqlconnect.jar in the common /lib directory
my entry in the server.xml file is as follows:
<Context path="/hibernate" docBase="hibernate">
<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:JSQLConnect://sanjay:1433//quickstart</value>
</parameter>
<parameter>
<name>driverClassName</name><value>com.jnetdirect.jsql.JSQLDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value> </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>

my hibernate.cfg.xml is as follows:
<?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.OracleDialect</property>

<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>

</session-factory>

</hibernate-configuration>

why am i getting the following error"
cannot open connection
no suitable driver

please reply me as soon thanks in advance to all
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Check your connection URL (jdbc:JSQLConnect://sanjay:1433//quickstart) is correct as per your driver documentation and that your driver is in your classpath.

Also, why are you trying to user the Oracle dialect with MSSQL? Shouldn't you be using the Sybase dialect?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat hibernate
 
Similar Threads
hibernate problem
Exception: Could not find datasource
DBCP datasource with Hibernate, help me?
Hibernate connection management problem?
Hibernate insert or select gives "Identifier of an instance altered"