level 1
发大打算
楼主
服务项里面数据库已经启动,而且也已经设置好了。可以连接了。但是在写JSP代码的时候,提示
GlassFish Server 4.1, deploy, Connection refused: connect, false
代码如下:
<%--
Document : Test
Created on : 2015-10-19, 8:28:58
Author : think
--%>
<%@page contentType = "text/html;charset=gb2312" %>
<%
java.sql.Connection conn = null;
java.lang.String strConn;
try{
conn = java.sql.DriverManager.getConnection("jdbc:mysql://localhost_3306/sample");
%>
连接数据库成功!
<%
}catch(java.sql.SQLException e){
out.println(e.toString());
}finally{
if(conn!=null)
conn.close();
}
%>
2015年10月25日 12点10分
1
GlassFish Server 4.1, deploy, Connection refused: connect, false
代码如下:
<%--
Document : Test
Created on : 2015-10-19, 8:28:58
Author : think
--%>
<%@page contentType = "text/html;charset=gb2312" %>
<%
java.sql.Connection conn = null;
java.lang.String strConn;
try{
conn = java.sql.DriverManager.getConnection("jdbc:mysql://localhost_3306/sample");
%>
连接数据库成功!
<%
}catch(java.sql.SQLException e){
out.println(e.toString());
}finally{
if(conn!=null)
conn.close();
}
%>