JDBC Servlet Example (contd.)
public class DBServlet extends HttpServlet {
//overriding service method
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
//fetch the parameters from the form input
String username = req.getParameter(“username”);
String password = req.getParameter(“password”);
String query = req.getParameter(“query”);
PrintStream out = new PrintStream (res.getOutputStream() );
String url = “jdbc:weblogic:oracle”; // JDBC driver url