The error shown because your database connection is closed. May i know where and when you close it ? is it in the sd.StaticData("TitleData")
if so, you can retrieve all the data (rs.getString()) in the StaticData method and return the data as List or HashMap to your jsp page.
so, in your jsp :
<% List data = sd.StaticData("TitleData")
<%
List singleData = null;
for( int i = 0 ; i < data.size() ; i ++ )
{
singleData = (List) data.get(i);
%>
<option value=<%= (String)singleData .get(1)%> > <%= (String)singleData .get(2)%> </option>
<%
}
%>
Main Topics
Browse All Topics





by: gocraigPosted on 2003-12-03 at 13:35:09ID: 9870033
I have just added code as follows in the JSP
actJdbc1Re sultSet.ne xt(Abstrac tJdbc1Resu ltSet.java :63) legatingRe sultSet.ne xt(Delegat ingResultS et.java:13 5) n.Personal Details_js p._jspServ ice(Person alDetails_ jsp.java:2 09) HttpJspBas e.service( HttpJspBas e.java:133 ) vlet.servi ce(HttpSer vlet.java: 856) JspServlet Wrapper.se rvice(JspS ervletWrap per.java:3 11) JspServlet .serviceJs pFile(JspS ervlet.jav a:301) JspServlet .service(J spServlet. java:248) vlet.servi ce(HttpSer vlet.java: 856)
ResultSetMetaData = rsmd = rs.getMetaData();
And have then added a couple of table rows/cells and the code
rsmd.getColumnCount()
rsmd.getColumnName(1)
rsmd.getColumnName(2)
this worked fine and told me the names of the columns that I was expecting, so the result set is getting as far as the JSP.
I then added some manipulation, adding a further row/cell containing
rs.getString(1)
It bummed out again, same error.
Is this not allowed for some reason.The root cause given in the logs is
Connection is closed. Operation is not permitted.
org.postgresql.jdbc1.Abstr
org.apache.commons.dbcp.De
org.apache.jsp.Registratio
org.apache.jasper.runtime.
javax.servlet.http.HttpSer
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
this has obvious references to PostgreSQL (my Db), is it because I am trying to manipulate the Resultset having passed it from Db to Bean to JSP ??