-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Sql Server 2005 configuration
PostPosted: Tue Jan 01, 2008 6:02 pm 
Newbie

Joined: Tue Jan 01, 2008 1:48 pm
Posts: 8
hi every body, i already wasted the 31 trying to get hibernate up and running, i simly cant get the application running, im using this configurai0n structure:

<!-- Database connection settings -->
<property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<!-- <property name="connection.url">jdbc:hsqldb:hsql://localhost</property>-->
<property name="connection.url">jdbc:microsoft:sqlserver:\\mancerainc/SQLExpress;SelectedMethod=cursor;DatabaseName=Empresa</property>
<property name="connection.username">user</property>
<property name="connection.password">usuario</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>


and i got this:



GRAVE: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL.
Exception in thread "main" org.hibernate.exception.GenericJDBCException: Cannot open connection


please help


Top
 Profile  
 
 Post subject: Re: Sql Server 2005 configuration
PostPosted: Tue Jan 01, 2008 6:44 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
I use jTDS and it works with this configuration:

Code:
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
            <property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
            <property name="hibernate.connection.username" value="sa"/>
            <property name="hibernate.connection.password" value="123"/>
            <property name="hibernate.connection.url"
                      value="jdbc:jtds:sqlserver://localhost/Farzad;TDS=8.0;instance=;bufferMaxMemory=4096"/>
            <property name="hibernate.max_fetch_depth" value="3"/>
            <property name="hibernate.show_sql" value="true"/>


Your jdbc url is not right and it should look like jdbc:sqlserver://localhost;integratedSecurity=true;

For more information you can see their website at http://msdn2.microsoft.com/en-us/library/ms378428.aspx


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 01, 2008 8:15 pm 
Regular
Regular

Joined: Sat Nov 25, 2006 11:37 am
Posts: 72
Replace the two backward slashes with // in your URL and see if that helps.


Top
 Profile  
 
 Post subject: hibernate Sql Server driver
PostPosted: Tue Jan 01, 2008 10:14 pm 
Newbie

Joined: Tue Jan 01, 2008 1:48 pm
Posts: 8
I really appreciate your response Farzad, you pointed me in right direction, i almost got crazy, ill post the solution for everybody:

* First you were right the url sintax was wrong for a local sql server instance is jdbc:sqlserver://localhost:4033;databaseName=MyDatabase

* The sql express express edition generates a dinamic tcp/ip port, so on
we must configure it : http://kamhungsoh.com/blog/labels/Database.html

Thanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.