-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate not connecting to SQL Server - Connection refused
PostPosted: Sun Apr 07, 2013 3:53 pm 
Newbie

Joined: Tue Apr 02, 2013 3:36 am
Posts: 4
Hi,
I'm trying out tapestry 5 web apps, using the tapestry framework itself, but using SQL Server instead of the built in Hibernate. Now, the app itself is building just fine, but I get the following error and can't retrieve data from my database:

[ERROR] util.JDBCExceptionReporter The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
org.hibernate.exception.JDBCConnectionException: Cannot open connection

TCP/IP connections are allowed, I've double checked firewall settings, and enabled every possible option for TCP/IP, and still something is blocking the connection. Even turned off all firewall settings and services, and still no change.

This is the hibernate.cfg.xml:

Code:
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
        <property name="hibernate.connection.url">jdbc:sqlserver://localhost;databaseName=testdb;integratedSecurity=true</property>
        <property name="hibernate.dialect">org.hibernate.dialect.SQLServer2008Dialect</property>
        <property name="hibernate.connection.username">dell-pc\Zoran Mitreski</property>
        <property name="hibernate.connection.password"></property>
        <property name="hbm2ddl.auto">update</property>
        <property name="hibernate.show_sql">true</property>
        <property name="hibernate.format_sql">true</property>
        <mapping resource="mappings/hibernate.hbm.xml" />
    </session-factory>
</hibernate-configuration>


Anyone have an idea what might be the reason?


Top
 Profile  
 
 Post subject: Re: Hibernate not connecting to SQL Server - Connection refused
PostPosted: Sun Apr 07, 2013 11:29 pm 
Newbie

Joined: Sun Apr 07, 2013 12:05 am
Posts: 3
Hi,
you need to check the following things in your cfg.xml
1. to check the Table name
2. Port number.
3.user id and password.
4.Dialect Name

-CR


Top
 Profile  
 
 Post subject: Re: Hibernate not connecting to SQL Server - Connection refused
PostPosted: Mon Apr 08, 2013 12:49 am 
Newbie

Joined: Tue Apr 02, 2013 3:36 am
Posts: 4
casimirrex wrote:
Hi,
you need to check the following things in your cfg.xml
1. to check the Table name
2. Port number.
3.user id and password.
4.Dialect Name

-CR


The port number is the default one for SQL - 1433, tried adding that to the connection URL, no change; the table name is inserted in the mapping file, and I'm not sure that that could cause the problem; I'm using Windows Authentication on SQL Server, hence integratedSecurity=true; tried both org.hibernate.dialect.SQLServerDialect and the one above, still the error appears.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.