Basic HTML version of Foils prepared 4 Feb 98

Foil 40 JDBC Servlet Example (contd.)

From Overview of JDBC and its use with CORBA or Java RMI CPS616 Technologies of Information Age -- Spring 1998. by Nancy McCracken(Sangetta Aggarwal, Udayan Parvate, Tom Pulikal)


1 Implementation :
2 public class DBServlet extends HttpServlet {
3 //overriding service method
4 public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
5 //fetch the parameters from the form input
6 String username = req.getParameter("username");
7 String password = req.getParameter("password");
8 String query = req.getParameter("query");
9 PrintStream out = new PrintStream (res.getOutputStream() );
10 String url = "jdbc:weblogic:oracle"; // JDBC driver url
11

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998