Results 1 to 8 of 8
  1. #1
    Lucy is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default SQLServerException error

    Hi,When I try to initialize the database by running a batch file,I am getting this error
    "class com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQLServer is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port"
    I am using SQLServer 2008R2.I made sure that server is running and that firewall is turned off.Can some1 let me know what are my other options to debug this?

    Thanks,
    Lucy

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: SQLServerException error

    What does this have to do with JDBC?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Lucy is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: SQLServerException error

    Where else should this be posted then?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: SQLServerException error

    You said
    I try to initialize the database by running a batch file
    Did you perhaps mean a Java program, not a batch file at all?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    mrweb is offline Member
    Join Date
    Mar 2012
    Posts
    4
    Rep Power
    0

    Default Re: SQLServerException error

    Open "SQL Sever Configuration manager" tool and check that TCP/IP is Enabled in "SQL server Network configuration" section.

  6. #6
    Lucy is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: SQLServerException error

    I checked SQL Sever Configuration manager tool and TCP/IP is enabled.And with respect to running batch file,the batch file which i am trying to run calls a Java class called InitializeDatabase where there is the code to initalize the db ,and from this file I am getting the error.I mean the error is mentioned in this java class.

  7. #7
    Lucy is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: SQLServerException error

    I fixed my error.In the SQLServer config Manager ->SQLServerNetworkConfiguration ->Protocols for <instancename>->TCP/IP->IPAddresses tab I set the IPAll to 1433 and the error got fixed.Thanks for the help though.

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: SQLServerException error

    Quote Originally Posted by Lucy View Post
    I fixed my error.In the SQLServer config Manager ->SQLServerNetworkConfiguration ->Protocols for <instancename>->TCP/IP->IPAddresses tab I set the IPAll to 1433 and the error got fixed.Thanks for the help though.
    So as I suspected, it wasn't a JDBC matter at all.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 09:31 AM
  2. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  3. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  4. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •