connecting to mysql

hi friends

after struglling with for so amny days i want someone to help me.PLZ HELP ME OUT

my web application is running on linux server with mysql on it.

it finds for DSN on tomcat and gives this error.please tell what the hell this error is

Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2569) at com.mysql.jdbc.Connection.(Connection.java:1485) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at com.MyBizChat.Util.DBConn1.makeConnection1(DBConn1.java:74) at org.apache.jsp.index_jsp._jspService(index_jsp.java:65) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) ** END NESTED EXCEPTION ** Last packet sent to the server was 1 ms ago.)

mysql connector file is placed there on tomcat DSN name is also correct

please help me out

thanks

[3306 byte] By [harrriiiia] at [2007-11-26 15:11:53]
# 1
The server name is wrong.orThe server port is wrongor You are being blocked by a firewall.
cotton.ma at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
hi,are u able to connect to mysql through mysql front?Verify port to which mysql is listeninghave you installed mysql connnector and set classpath for that ?arvin
aravin123a at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
DSN?On a Linux server?Could you review your terminology and make sure you are posting correct information?
DrClapa at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
DSN name is on tomcat server under adminmy java application finds for that DSN in context
harrriiiia at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
> DSN?> > On a Linux server?> > Could you review your terminology and make sure you> are posting correct information?I think that's just confused terminology usage. The stack trace shows the MySQL type 4 driver is being used.
cotton.ma at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6
i am able to establish to mysql FROM MY LOCAL MACHINE
harrriiiia at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 7
> i am able to establish to mysql FROM MY LOCAL MACHINEOKAY! But not from the server Tomcat is running on apparently. Connection refused is a TCP/networking problem. Hence you either have some incorrect information or a firewall issue.
cotton.ma at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 8
LET ME EXPLAIN THE WHOLE PROBLEMIF I RUN MY APPLICATION ON LOCAL TOMACT AND TRY TO CONNECT TO DATABASE ON SERVER IT RUNS WELL AND GOODBUT WHEN I PLACE THE SAME APPLICATION ON TOMCAT WHICH IS ON THE SAME MACHINE WHERE MYSQL 4.1 IS THEN IT GIVES THIS ERROR
harrriiiia at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 9

> LET ME EXPLAIN THE WHOLE PROBLEM

>

> IF I RUN MY APPLICATION ON LOCAL TOMACT AND TRY TO

> CONNECT TO DATABASE ON SERVER IT RUNS WELL AND GOOD

>

> BUT WHEN I PLACE THE SAME APPLICATION ON TOMCAT WHICH

> IS ON THE SAME MACHINE WHERE MYSQL 4.1 IS THEN IT

> GIVES THIS ERROR

I don't know why you are shouting but I wish you would stop.

All you have to do is read the answers provided several times now. I don't really care what your setup is, it's irrelevent, your problem is one of the ones I listed so go and figure it out.

And stop shouting.

cotton.ma at 2007-7-8 9:02:57 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...