hi, you didn�t set the content type of the response, didn�t send the
"<html>" tag! i think maybe this would be some of the problems.

I use the method doGet and doPost to handle request from the clients. If you
send me the HTML syntax of the page who request this servlet i can show you
what can be the problem!


>   could any  one can help me?
>   source code hope this is correct
>   import java.io.*;
>import java.sql.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>
>public class user extends HttpServlet
>{
>     Statement st;
>     public void service(HttpServletRequest req,HttpServletResponse
>res)
>     {
>
>          try
>          {
>          ServletOutputStream sos=res.getOutputStream();
>          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>// databse is msaccess
>          Connection
>con=DriverManager.getConnection("jdbc:odbc:sunil");
>          st=con.createStatement();
>          ResultSet rs=st.executeQuery("Select * from log");
>          while(rs.next())
>          {
>               String str=rs.getString(1);
>               res.setContentType("text/html");
>              sos.println("the user_id is "+str);
>               }
>         }
>          catch(Exception e)
>          {   }
>      }
>}

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to