please help NonRegisteringDriver.java:395

i am trying too connecting jsp with mysql on linux operrating system

some time back it was it was conneting perfecctly i am using mysqlconnector for the connection

please can you help what can be the problem exception i am getting is

type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:414)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

javax.servlet.ServletException: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)

org.apache.jsp.chklogin_jsp._jspService(chklogin_jsp.java:121)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused

com.mysql.jdbc.Connection.createNewIO(Connection.java:1690)

com.mysql.jdbc.Connection.<init>(Connection.java:427)

com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:395)

java.sql.DriverManager.getConnection(DriverManager.java:582)

java.sql.DriverManager.getConnection(DriverManager.java:207)

org.apache.jsp.chklogin_jsp._jspService(chklogin_jsp.java:63)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

before the Error start coming i have made a small change in my IP address can it affect the connectivity.

[3035 byte] By [amitshrutia] at [2007-11-26 16:26:59]
# 1
ip address of what? your db machine? yes it will affect1. first check the ip address of your db machine2. check if your mysql is running3. check the port of where your mysql port is running whether it is blocked or not
jgalacambraa at 2007-7-8 22:51:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

thanks for you reply .....

well i have resolved the thing with help of your help

i had changed the IP of the machine as i was using localhost to connect to mysql

now it was not connecting with the "localhost" tag my pages are opening with tomacat is running with

localhost:8080/webapplication/

but for mysql now i have changed the DBURL to new IP Address instead of localhost

and its working

Can you tell any more about this ..

amitshrutia at 2007-7-8 22:51:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...