查询的标签:


JDBC中的Communications link failure due to underlying exception错误的解决办法

标签: , , and

问题描述:使用JDBC连接Mysql数据库时,出现“Connection reset”错误,抛出如下异常:
Connection couldn't be established to jdbc:mysql://***/***?user=***&password=********
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: 

** BEGIN NESTED EXCEPTION ** 
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception: ...

5 Comments »

Structs网站中Java获取文件路径问题

标签: and

今天做一个天气预报的Mashup,本来是挺简单的,不过最后却被java的路径问题卡了很久。在Jsp页面上的路径是相对于WebRoot,而在java中就不是。尝试了很多方法,包括绝对路径以及相对路径,后来发现都出错。上网查了一下,发现下面这篇文章不错,转载一下:
http://blog.csdn.net/shendl/archive/2006/12/03/1427475.aspx
而我做的事就是“在Web应用程序中资源的寻址”,也就是使用...

1 Comment »