Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 import java.io.*;
- 1 import java.io.*;
- 2 import javax.servlet.*;
- 3 import javax.servlet.http.*;
- 4 import java.util.*;
- 5 import java.sql.*;
- 6 public class movie extends HttpServlet {
- 7
- 8 public void doGet(HttpServletRequest request,
- 9 HttpServletResponse response)throws ServletException ,IOException {
- 10 response.setContentType("text/html");
- 11 PrintWriter out = response.getWriter();
- 12
- 13 String title = "Movie Database";
- 14 try{
- 15 Class.forName("oracle.jdbc.driver.OracleDriver");
- 16 }catch(ClassNotFoundException e){
- 17 out.println("CLASS NOT FOUND: "+e.getMessage());
- 18 }
- 19
- 20 try{
- 21 Connection con = DriverManager.getConnection("jdbc:oracle:th
- in:@oracle.cse.sc.edu:2312:CSE.SC.EDU","username","password");
- 22 }catch(Exception e){
- 23 out.println(e);
- 24 }
- 25
- 26 out.println(
- 27
- 28 "<BODY>\n"+
- 29 "<H1 ALIGN=CENTER>" + title +"</H1>\n"
- 30 );
- 31
- 32 }
- 33
- 34 public void doPost(HttpServletRequest request,
- 35 HttpServletResponse response)
- 36 throws ServletException, IOException {
- 37 doGet(request,response);
- 38 }
- 39 }
- 40
- 41
- 42
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement