Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having problems with sql connection

 
Varun Nambuthiri
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

I am having problems with connecting ms sql server 2008 ...

At first i gave

and for some reason I had to change the computer I was working on so now its displaying "JavaScript Validator " and NullPointerException and now I m using ms sql server 2008 and previously I was using 2005

And I also something you should know that I was working on Eclipse Europa and now I am working on Helios

Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64837
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum. Hopefully you aren't doing this sort of thing in a JSP!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What sort of error do you see in the logs?
 
Varun Nambuthiri
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya sorry about that ..

So the error is about the problem in connection with the database and is showing given lines and the source of problems
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A vague description of the error is hard to work with! Not sure we can help without more detail. A stack trace it will contain useful information, can you post it?
 
Varun Nambuthiri
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now heres the stack trace

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: Network error IOException: Connection refused: connect
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:409)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

javax.servlet.ServletException: java.sql.SQLException: Network error IOException: Connection refused: connect
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:898)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:827)
org.apache.jsp.jsp.checkuser_jsp._jspService(checkuser_jsp.java:129)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:73)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:378)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

java.sql.SQLException: Network error IOException: Connection refused: connect
net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:410)
net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.apache.jsp.jsp.checkuser_jsp._jspService(checkuser_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:73)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:378)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

java.net.ConnectException: Connection refused: connect
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(Unknown Source)
java.net.PlainSocketImpl.connectToAddress(Unknown Source)
java.net.PlainSocketImpl.connect(Unknown Source)
java.net.SocksSocketImpl.connect(Unknown Source)
java.net.Socket.connect(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:307)
net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:257)
net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:311)
net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.apache.jsp.jsp.checkuser_jsp._jspService(checkuser_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:73)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:378)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Connection refused: connect

Your connection has been refused. Things to check:
  • There is a server running at the host you specify
  • You are using the correct credentials to login
  • SQL Server is configured to support SQL server authentication (by default its not)
  • SQL Server is configured to allow connections over TCP/IP (by default it is not)
  •  
    Varun Nambuthiri
    Ranch Hand
    Posts: 76
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    So how am I supposed to things 3 and 4 ?
     
    Paul Sturrock
    Bartender
    Posts: 10336
    Eclipse IDE Hibernate Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Either ask the person who administers your SQL server instance for you, or via management studio and the network configuration too.
     
    Varun Nambuthiri
    Ranch Hand
    Posts: 76
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Now that is where the problem begins I am the one who "administers" sql server instance and have no idea what to do
     
    Paul Sturrock
    Bartender
    Posts: 10336
    Eclipse IDE Hibernate Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Well, the documentation covers most of this. If you are planning to do much administration I'd start to read through these. Long term this will make things easier.

    For now, to check what kind of authentication your instance supports use SQL Server Management Studio to view the security properties. By default it will be "Windows Authentication Mode"; for the connection string you supply you need "SQL Server and Windows Authentication Mode".

    To find out if your server is configured to allow connections over TCP/IP, use SQL Serve Configuration Manager. There's a section that lists the protocols enabled for your server.
     
    Varun Nambuthiri
    Ranch Hand
    Posts: 76
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks

    But the problem is I am a beginner to MS SQL server ....so I dont know anything about it ... please help or a decent documentation will do ...
     
    Paul Sturrock
    Bartender
    Posts: 10336
    Eclipse IDE Hibernate Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The documentation on MSDN is pretty comprehensive.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic