This Text file is old! In a 🏛️Museum, an unsorted archive of (user-)pages. (Saved from Geocities in Oct-2009. The archival story: oocities.org)
--------------------------------------- (To
🚫report any bad content: archivehelp @ gmail.com)
/* CarSearch.java
*
*
* Function: This is a servlet program which receives parameters sent from the client and
* make a SQL query then send to the database inventory, get data from it, and then use the
* data sent by database to make a HTML file and send it to the client side for display
*
*
*/
package hall;
import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.*;
import java.lang.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*CarSearch
*/
public class CarSearch extends HttpServlet
{
public static final String DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
public static final String URL = "jdbc:odbc:car";
//override doGet method to get request from client and send response to it
public void doGet(
HttpServletRequest request,
HttpServletResponse response)
//catch all the exceptions
throws ServletException, IOException
{
response.setContentType("text/html");
//set output type
PrintWriter out = response.getWriter();
String make = request.getParameter("make");
String transtype = request.getParameter("transtype");
String minprice_temp = request.getParameter("minprice");
String maxprice_temp = request.getParameter("maxprice");
String minyear_temp= request.getParameter("minyear");
String maxyear_temp= request.getParameter("maxyear");
int minprice = Integer.parseInt(minprice_temp);
int maxprice = Integer.parseInt(maxprice_temp);
int minyear = Integer.parseInt(minyear_temp);
int maxyear = Integer.parseInt(maxyear_temp);
//Display the result set
out.println("