servlet sample projects

i am a java programmer working on JDBC & Swing API. i want myself exposed to projects in Servlet API. So i any of u can provide me a sample project on Servlet it will be much helpful.
magdom_khajaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AHadiACommented:
u can impleament a webmail service by servlet it has good new point to learn .
u can touch me and i  will give u more information.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brlmutiaCommented:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
//import java.util.*;


public class DBRead extends HttpServlet
    implements SingleThreadModel
{
    String resultsDir;
   
    public void init(ServletConfig config)
      throws ServletException {

      super.init(config);
      
    }
   

    public void doGet(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException
    {

      res.setContentType("text/html");

        PrintWriter toClient = res.getWriter();

        try {

          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

          Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@150.10.50.8:1521:orcl",
                                             "scott", "tiger");

          Statement stmt = conn.createStatement ();

          ResultSet rset = stmt.executeQuery ("select * from EMP");
      
          toClient.println("<HTML> <BODY>" );
          
          while (rset.next ()) {
            toClient.println ("<BR>" + rset.getString (1) + "   " + rset.getString (2) + "   " +
                                 rset.getString (3) + "   " + rset.getString (4) + "   " +
                                 rset.getString (5) + "   " + rset.getString (6) + "   " +
                                 rset.getString (7) + "   " + rset.getString (8) );
          }
          
          toClient.println("</BODY> </HTML>");
          
          toClient.close();
          conn = null;
          
      } catch(SQLException e) {

          e.toString();         
          
        }
      
    }
}

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.