• Post Reply Bookmark Topic Watch Topic
  • New Topic

tomcat hibernate

 
alec stewart stewart
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!