Hi Bill,
The details of the IOException are as under:
HANDLER
THREAD PROBLEM:java.io.IOException: Socket Closed
java.io.IOException:Socket Closed
at java.net.PlainSocketImpl.getInputStream(Unknown Source)
at java.net.Socket$1.run(Unknown Source)
at java.net.security.AccessController.doPrivileged(Native Method)
at java.net.Socket.getInputStream(Unknown Source)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)
com.sun.web.core.DefaultServlet:init
I am using JSWDK incase it helps and my prg. is as follows:
import java.sql.*;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class trial extends HttpServlet
{
private Connection dbConn=null;
private Statement st=null;
private ResultSet rs=null;
private
String word=null;
private String query=null;
public void init(ServletConfig config) throws ServletException
{
super.init(config);
try
{
//load jdbc-odbc bridge
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//establish database connection to netsparsh
dbConn=DriverManager.getConnection("jdbc

dbc:netsparsh");
System.out.println("connection established");
}
//thrown by Class.forName
catch(ClassNotFoundException e)
{
System.out.println("JDBC-ODBC bridge not found");
return;
}
catch(SQLException e)
{
System.out.println("SQL Exception thrown in init!");
}
System.out.println("At the end of init");
}
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
ServletException,IOException
{
System.out.println("In do Get OF trial Servlet");
if (req.getParameter("address")==null)
word="dias";
else
{
word=req.getParameter("address");
System.out.println(
word);
}
try
{
st=dbConn.createStatement();
System.out.println("Statement created");
query="select membership_no,url from member where lcase(name)='"+(word)+"' ";
System.out.println(query);
rs=st.executeQuery(query);
System.out.println(rs);
if(rs.next()==true)
res.sendRedirect(rs.getString("url"));
else
res.sendRedirect("http://168.0.0.7:8080/netsparsh/notfound.html");
System.out.println("Redirect executed");
}
catch(SQLException _se)
{
System.out.println("Query not executed correctly");
}
}
public void destroy()
{
try
{
dbConn.close();
}
catch(SQLException se)
{
System.out.println("SQLException thrown in destory !");
}
}
}