1

I created a spring mvc application to connect with sqlserver database. I used jtds driver for connection.

<beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <beans:property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
    <beans:property name="url"
        value="jdbc:jtds:sqlserver://localhost:1433;databaseName=3PLTest;" />
    <beans:property name="username" value="sa" />
    <beans:property name="password" value="sa" />
</beans:bean>

When i am trying to run the server it gives the error.

ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Cannot create PoolableConnectionFactory (Network error IOException: Connection refused: connect)
Nov 03, 2014 10:33:46 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/warehouse] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection] with root cause
java.net.ConnectException: Connection refused: connect

I am using SQLEXPRESS. How does this happen?

rohi
  • 320
  • 1
  • 5
  • 20

1 Answers1

0

Have you enabled the TCP/IP protocol to your localhost SQL Server installation?

SQL Server connection refused

Community
  • 1
  • 1
alfcope
  • 2,327
  • 2
  • 13
  • 21