본문 바로가기

개발/JAVA

org.apache.jasper.JasperException: javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

 

 

이클립스에서 새로 branch 따서 작업하려고 하는데,

org.apache.jasper.JasperException: javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

 

가 뜨면서 페이지 진입이 안되었음.

 

구글링 열심히 해보니

https://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai

 

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

I'm working on getting my database to talk to my Java programs. Can someone give me a quick and dirty sample program using the JDBC? I'm getting a rather stupendous error: Exception in thread "m...

stackoverflow.com

 

sql 접속 정보에 localhost라고 되어있는 부분을 IP주소로 대체해주라고 하는 답변 발견.

ex) 

Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/DBname", "root", "root");

Connection con = DriverManager.getConnection( "jdbc:mysql://192.100.0.000:3306/DBname", "root", "root");

Replacement of Localhost to your IP address

 

바꿨더니 아-주 잘 작동함

 

 

반응형