Postgresql JDBCのconnect error
Vine Linux2.6, Tomcat5, Postgresql7.4.3の環境で、
簡単なDBへアクセスのJspを作りましたが、実行したら、次のエラーができましたが、解決方法を
教えてください。
JSP File:
<HTML>
<HEAD><TITLE>User List</TITLE></HEAD>
<BODY>
<%@ page import="java.sql.*" %>
<TABLE BORDER=1 width="75%">
<TR><TH>UID</TH><TH>Password</TH></TR>
<%
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try {
Class.forName("org.postgresql.Driver").newInstance();
conn =
DriverManager.getConnection("jdbc:postgresql://xxx.xxxx.xx.xx:8080/webshop","postgres","xxxx");
st = conn.createStatement();
rs = st.executeQuery("select * from tbllogin");
while(rs.next()) {
%>
<TR><TD><%= rs.getString("fldlogid") %></TD>
<TD><%= rs.getString("fldpwd") %></TD></TR>
<%
}
%>
</TABLE>
<%
} catch (Exception ex) {
ex.printStackTrace();
%>
</TABLE>
Ooops, something bad happened:
<%
} finally {
if (rs != null) rs.close();
if (st != null) st.close();
if (conn != null) conn.close();
}
%>
</BODY>
</HTML>
Tomcat5のログcatalina.out:
org.postgresql.util.PSQLException: The backend has broken the connection. Possibly the action you have attempted has caused it to close.
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:168)
at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(AbstractJdbc1Connection.java:291)
.....