• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Failed to set Database Connection

 
Melissa Goh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

Hi, I've got the above error message when I was trying to set my database connection in JDeveloper, a jsp editor.

What I did what this:-

jdbc:sqlserver://myIPAdd:1433;SelectMethod=cursor;DatabaseName=Z_Test

What I've done:-
- Since when I ran my jsp page during (performed without setting database connection) testing and saw that the address bar displayed "http://myIPAdd:8988/untitled1.jsp", I changed my port in sqlserver to 8988 and I still get the error so I change back.

- Tried to connect to a database from another IP address, it was successful.

Can anyone tell where is my mistake?

P/S I hope I'm in the right category of this forum.
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Melissa Goh wrote:Since when I ran my jsp page during (performed without setting database connection) testing and saw that the address bar displayed "http://myIPAdd:8988/untitled1.jsp", I changed my port in sqlserver to 8988 and I still get the error so I change back.


That 8988 port is HTTP port use to connect to your Application/Web server. SQL Server port is different which your configuaration for the database must be using.
 
Melissa Goh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:That 8988 port is HTTP port use to connect to your Application/Web server. SQL Server port is different which your configuaration for the database must be using.


Okay..I changed back my sqlserver port to 1433 and still can't set the connection.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your SQL Server instance configured to accept TCP/IP connections? Out the box for 2005 up this is not the case.
 
Melissa Goh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:Is your SQL Server instance configured to accept TCP/IP connections? Out the box for 2005 up this is not the case.


I'm using SQL Server 2000. I've checked in Server Network Utility, my TCP/IP is enabled. Is this what you mean?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Are you running a Firewall?
 
Melissa Goh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope..I'm not using firewall
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic