Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Logic error? HELP PLEASE! :(

Have Programming Question? Ask it here!
 
 
 


Derrick Tan
Logic error? HELP PLEASE! :(
0 Answer(s)      2 years and a month ago
Posted in : JSP-Servlet


Hello Guys! i have a huge problem. What I want to do is there is a retrieve jsp page. In the retrieve jsp page there is a text box which user to key in their email and one more dropdownlist which get the date from mysql using the matched email. First let the user key in the email. then use the email to get the date and populate into the dropdown list. I have a method to get the date using the email and other method to get its personal info using its date and email together. However if I don key in my email the page forward to the result page then all is display as null. But if I key in my email the page stuck which shows a blank page. By right it should display the date using the email keyed in.

Retrieve.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

<%@page import="java.util.ArrayList" %>
<%@page import="javax.servlet.http.HttpSession" %>
<jsp:useBean id="dataBean" class="sg.edu.nyp.DataBean" scope="session" />
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Get Quick Quote</title>
    <link href="theme/styles/car-insurance.css" type="text/css" rel="stylesheet" />
    <link href="theme/styles/thickbox.css" type="text/css" rel="stylesheet" />
    <style type="text/css">
        #forms
        {
            background-color: #FAFAFA;
            border: 1px solid #BDBDBD;
            color: #333333;
            margin-top: 10px;
            margin-bottom: 10px;
            padding: 15px 10px;
        }
        .retrieve
        {
            font-size: 1.1em;
        }
    </style>
</head>
<body class="tundra">
    <div id="wrapper" style="margin: left; border-color: #333399; background-color: #FFFFFF">
        <div>
            <div align="center">
                <img src="theme/images/header.png" border="0" alt="" /></div>
        </div>
        <div id="forms">
            <form action="/CarInsurancePortal/RetrieveDataServlet" method="post" name="RetrieveForm">
            <center>
                <table cellspacing="0" cellpadding="0" width="70%" border="0" class="retrieve">
                    <tr align="left">
                        <td colspan="2" align="center">
                            <h1>
                                Car Insurance - Retrieve Quotes</h1>
                        </td>
                    </tr>
                    <tr align="left">
                        <td colspan="2" align="left">
                            Welcome back! To retrieve your saved Quick Quotes, please enter your Email Address.
                        </td>
                    </tr>
                    <tr align="left">
                        <td>
                            ¬ 
                        </td>
                        <td>
                            ¬ 
                        </td>
                    </tr>
                    <tr align="left" valign="middle">
                        <td width="100">
                            Email Address¬ 
                        </td>
                        <td>
                        <% if (request.getSession().getAttribute("emailAddress") == null){ %>
                            <input value="" class="textbox_field" id="emailAddress" size="41" name="emailAddress" type="text" />
                        <%}%>

                        <% if (request.getSession().getAttribute("emailAddress") != null){ %>
                            <input value="<%=(String)request.getSession().getAttribute("emailAddress") %>" class="textbox_field" id="emailAddress" size="41" name="emailAddress" type="text" />
                        <%} %>
                        </td>
                    </tr>
                    <tr align="left">
                        <td>
                            ¬ 
                        </td>
                        <td>
                            ¬ 
                        </td>
                    </tr>
                    <tr align="left" valign="middle">
                        <td>
                            Date Time Saved
                        </td>
                        <td>
                            <select class="dropdown_field" id="dateSaved" name="dateSaved">
                                <% if (request.getSession().getAttribute("dateSavedList") !=null){
        ArrayList<String> list = (ArrayList<String>)request.getSession().getAttribute("dateSavedList"); %>
                                <% for (int i=0; i < list.size(); i++){ %>
                                <option id="dateSaved" value="<%=list.get(i) %>">
                                    <%=list.get(i) %></option>
                                <% } }%>
                            </select>
                        </td>
                    </tr>
                    <tr align="left">
                        <td>
                            ¬ 
                        </td>
                        <td>
                            ¬ 
                        </td>
                    </tr>
                    <tr align="left">
                        <td>
                            ¬ 
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
                <table cellspacing="0" cellpadding="0" width="70%" border="0" class="retrieve">
                <tr align="left" valign="middle">
                        <td>
                            <span class="text-red">
                            <% if (request.getSession().getAttribute("errorEmail") != null){
                                    String s = (String)request.getSession().getAttribute("errorEmail");
                                    try { out.println(s); } 
                                    catch(Exception e) {}
                            } %>
                            </span>
                        </td>
                    </tr>
                    <tr align="left">
                        <td>
                            ¬ 
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr align="left" valign="middle">
                        <td>
                            <input onclick="" type="image" src="image/car-insurance/btn_retrieve.png" value="Retrieve" name="Retrieve" />
                        </td>
                    </tr>
                </table>
            </center>
            </form>
        </div>
    </div>
</body>
</html>

RetrieveDataServlet.java

package sg.edu.nyp;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.sql.*;
import java.sql.*;
/**
 * Servlet implementation class RetrieveDataServlet
 */
public class RetrieveDataServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
    /**
     * @see HttpServlet#HttpServlet()
     */
    public RetrieveDataServlet() {
        super();
    }
    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
     *      response)
     */
    protected void doGet(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
    }
    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
     *      response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpSession session = request.getSession(true);
        session.setAttribute("emailAddress", "");

        DataBean retrievebean = new DataBean();
        String email; 
        email= request.getParameter("emailAddress");
        String datesaved;




        if (request.getParameter("dateSaved")==null){
            System.out.println("hello");
            System.out.println (retrievebean.retrieveDateSaved(email));
            //datesaved=(request.getParameter("dateSaved"));
            request.getRequestDispatcher("retrieve.jsp").forward(request, response);
        }
        else if (request.getParameter("dateSaved")!=null)
        {
            System.out.print("hello");
            datesaved=(request.getParameter("dateSaved"));
              //String url = "jdbc:mysql://localhost:3306/";
              //String dbName = "user_register";

              //String userName = "root"; 
              //String password = "mysql";
              Statement st = null;
              ResultSet rs = null;

              try {
                  String sql ="SELECT * FROM client_info WHERE email_address ='"+ email +"' AND date_saved= '"+ datesaved+ "'";
                    // Loads the mySQL driver
                    Class.forName("com.mysql.jdbc.Driver");
                    // Connect to the FRIENDS database in mySQL
                    // assuming userid = root and the password is password
                    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/novadb?create=true", "root", "mysql");
                    st= con.createStatement();
                    rs =st.executeQuery(sql);
                    while (rs.next()){
                    String familyname=rs.getString("family_name");
                    String givenname= rs.getString("given_name");
                    String fullname= rs.getString ("full_name");
                    String occupation = rs.getString("occupation");
                    String drivingcover =rs.getString("driving_cover_start_date");
                    String ncd = rs.getString("driving_ncd");
                    String age =rs.getString("age");
                    String Email =rs.getString("email_address");
                    String drivingClaims =rs.getString("driving_claim_againts");
                    String gender = rs.getString("gender");
                    String M_status = rs.getString("marital_status");
                    String driving_years = rs.getString("driving_years_license_held");
                    String demeritPoints = rs.getString("driving_demerit_points");
                    String carmodel = rs.getString("car_model");
                    String MakeYear = rs.getString("car_year_of_make");
                    String offpeak = rs.getString("car_offpeak");
                    String premium = rs.getString("premium");
                    retrievebean.setGivenName(givenname);
                    retrievebean.setFamilyName(familyname);
                    retrievebean.setFullName(fullname);
                    retrievebean.setDriving_ncd();
                    retrievebean.setDriving_modifications(rs.getString("driving_modifications"));
                    retrievebean.setEmailAddress(rs.getString("email_address"));
                    retrievebean.setAge(age);
                    retrievebean.setDriving_claim_againts(drivingClaims);
                    retrievebean.setGender(gender);
                    retrievebean.setMaritalStatus(M_status);
                    retrievebean.setDriving_years_license_held(driving_years);
                    retrievebean.setDriving_demerit_points(demeritPoints);
                    retrievebean.setCar_model(carmodel);
                    retrievebean.setCar_year_of_make(MakeYear);
                    retrievebean.setCar_offpeak(offpeak);
                    retrievebean.setDriving_cover_start_date(drivingcover);
                    retrievebean.setOccupation(occupation);
                    //retrievebean.setPremium(premium);
                    }



                    request.getSession(true).setAttribute("dataBean", retrievebean);

                    request.getRequestDispatcher("getQuote.jsp").forward(request, response);
              }

              catch (Exception e)
              {
              }

        }

        if ((request.getParameter("emailAddress") != null) && (request.getParameter("emailAddress") != "")) {
            EmailValidator checkEmail = new EmailValidator();
            if((checkEmail.validateEmail(request.getParameter("emailAddress"))!= ""))
            {
                session.setAttribute("errorEmail", checkEmail.validateEmail(request.getParameter("emailAddress")) + " Please input a valid email address.");
                request.getRequestDispatcher("retrieve.jsp").forward(request, response);
            }
            else
            {
                DataBean dataBean = new DataBean();
                dataBean.setInputEmailAddress(request.getParameter("emailAddress"));
                ArrayList<String> list = dataBean.retrieveDateSaved(request.getParameter("emailAddress"));
                session.setAttribute("emailAddress", request.getParameter("emailAddress"));
                session.setAttribute("dateSavedList", list);

                if(list.size() > 0)
                {
                    session.setAttribute("errorEmail", "");
                }
                else
                {
                    session.setAttribute("errorEmail", "The email address does not exist in our database.");
                }




                /*if (datesaved == null){
                    System.out.println (retrievebean.retrieveDateSaved(email));
                    datesaved=(request.getParameter("dateSaved"));
                    request.getRequestDispatcher("retrieve.jsp").forward(request, response);

                }
                if (datesaved !=null)
                {

                    datesaved=(request.getParameter("dateSaved"));
                  //String url = "jdbc:mysql://localhost:3306/";
                  //String dbName = "user_register";

                  //String userName = "root"; 
                  //String password = "mysql";
                  Statement st = null;
                  ResultSet rs = null;

                  try {
                      String sql ="SELECT * FROM client_info WHERE email_address ='"+ email +"' AND date_saved= '"+ datesaved+ "'";
                        // Loads the mySQL driver
                        Class.forName("com.mysql.jdbc.Driver");
                        // Connect to the FRIENDS database in mySQL
                        // assuming userid = root and the password is password
                        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/novadb?create=true", "root", "mysql");
                        st= con.createStatement();
                        rs =st.executeQuery(sql);
                        while (rs.next()){
                        String familyname=rs.getString("family_name");
                        String givenname= rs.getString("given_name");
                        String fullname= rs.getString ("full_name");
                        String occupation = rs.getString("occupation");
                        String drivingcover =rs.getString("driving_cover_start_date");
                        String ncd = rs.getString("driving_ncd");
                        String age =rs.getString("age");
                        String Email =rs.getString("email_address");
                        String drivingClaims =rs.getString("driving_claim_againts");
                        String gender = rs.getString("gender");
                        String M_status = rs.getString("marital_status");
                        String driving_years = rs.getString("driving_years_license_held");
                        String demeritPoints = rs.getString("driving_demerit_points");
                        String carmodel = rs.getString("car_model");
                        String MakeYear = rs.getString("car_year_of_make");
                        String offpeak = rs.getString("car_offpeak");
                        String premium = rs.getString("premium");
                        retrievebean.setGivenName(givenname);
                        retrievebean.setFamilyName(familyname);
                        retrievebean.setFullName(fullname);
                        retrievebean.setDriving_ncd();
                        retrievebean.setDriving_modifications(rs.getString("driving_modifications"));
                        retrievebean.setEmailAddress(rs.getString("email_address"));
                        retrievebean.setAge(age);
                        retrievebean.setDriving_claim_againts(drivingClaims);
                        retrievebean.setGender(gender);
                        retrievebean.setMaritalStatus(M_status);
                        retrievebean.setDriving_years_license_held(driving_years);
                        retrievebean.setDriving_demerit_points(demeritPoints);
                        retrievebean.setCar_model(carmodel);
                        retrievebean.setCar_year_of_make(MakeYear);
                        retrievebean.setCar_offpeak(offpeak);
                        retrievebean.setDriving_cover_start_date(drivingcover);
                        retrievebean.setOccupation(occupation);
                        //retrievebean.setPremium(premium);
                        }


                        session.setAttribute("errorEmail", "Do not blank. Please input a valid email address.");
                        request.getSession(true).setAttribute("dataBean", retrievebean);

                        request.getRequestDispatcher("getQuote.jsp").forward(request, response);
                  }

                  catch (Exception e)
                  {
                  }*/

            }
        }

    }
}

DataBean.java

package sg.edu.nyp; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Random; import java.io.; import javax.servlet.; import javax.servlet.http.; import javax.sql.; import java.sql.*; public class DataBean { Calendar calendar = Calendar.getInstance(); private boolean filled = false; private String nric; private String salutation; private String familyName; private String givenName; private String fullName; private String dob; private String gender; private String age; private String occupation; private String maritalStatus; private String postalCode; private String emailAddress; private String carregnum; private String carmodel; private String caryearofmake; private String caroffpeak; private String drivingyearslicenseheld; private String drivingncd; private String drivingcoverstartdate; private String drivingclaimagaints; private String drivingdemeritpoints; private String driving_modifications; private String carType; private String typeOfUse; private String engineCapacity; private String amountExcess;

private String quoterefno; private String premium; private String date_saved; private static final String ALPHABET = "01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Random r = new Random(); public boolean isFilled() { return filled; } public void setFilled(boolean filled) { this.filled = filled; } /* Date Array */ private ArrayList dateArray;

public ArrayList getDateArray() { return dateArray; } public void setDateArray(ArrayList dateArray) { this.dateArray = dateArray; } /* Date Array */

/* Retrieve by email address */ private String inputEmailAddress;

public String getInputEmailAddress() { return inputEmailAddress; } public void setInputEmailAddress(String inputEmailAddress) { this.inputEmailAddress = inputEmailAddress; } /* Retrieve by email address */

public String getNric() { return nric; } public void setNric(String nric) { this.nric = nric; } public String getSalutation() { return salutation; } public void setSalutation(String salutation) { this.salutation = salutation; } public String getFamilyName() { return familyName; } public void setFamilyName(String familyName) { this.familyName = familyName; } public String getGivenName() { return givenName; } public void setGivenName(String givenName) { this.givenName = givenName; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public String getDob() { return dob; } public void setDob(String dob) { this.dob = dob; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getAge() { return age; }
public void setAge(String ageYear) { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); String current = dateFormat.format(calendar.getTime()); this.age = Integer.toString(Integer.parseInt(current.substring(6,10)) - Integer.parseInt(ageYear)); } public String getOccupation() { return occupation; } public void setOccupation(String occupation) { this.occupation = occupation; } public String getMaritalStatus() { return maritalStatus; } public void setMaritalStatus(String maritalStatus) { this.maritalStatus = maritalStatus; } public String getPostalCode() { return postalCode; } public void setPostalCode(String postalCode) { this.postalCode = postalCode; } public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } public String getCarregnum() { return carregnum; } public void setCarregnum(String carregnum) { this.carregnum = carregnum; } public String getCarmodel() { return carmodel; } public void setCarmodel(String carmodel) { this.carmodel = carmodel; } public String getCaryearofmake() { return caryearofmake; } public void setCaryearofmake(String caryearofmake) { this.caryearofmake = caryearofmake; } public String getCaroffpeak() { return caroffpeak; } public void setCaroffpeak(String caroffpeak) { this.caroffpeak = caroffpeak; } public String getDrivingyearslicenseheld() { return drivingyearslicenseheld; } public void setDrivingyearslicenseheld(String drivingyearslicenseheld) { this.drivingyearslicenseheld = drivingyearslicenseheld; } public String getDrivingncd() { return drivingncd; } public void setDrivingncd() { if (Integer.parseInt(this.drivingyearslicenseheld) == 0) { this.drivingncd = Double.toString(0.0); } else if (Integer.parseInt(this.drivingyearslicenseheld) == 1) { this.drivingncd = Double.toString(0.1); } else if (Integer.parseInt(this.drivingyearslicenseheld) == 2) { this.drivingncd = Double.toString(0.2); } else if (Integer.parseInt(this.drivingyearslicenseheld) == 3) { this.drivingncd = Double.toString(0.3); } else if (Integer.parseInt(this.drivingyearslicenseheld) == 4) { this.drivingncd = Double.toString(0.4); } else if (Integer.parseInt(this.drivingyearslicenseheld) >= 5) { this.drivingncd = Double.toString(0.5); } } public String getDrivingcoverstartdate() { return drivingcoverstartdate; } public void setDrivingcoverstartdate(String drivingcoverstartdate) { this.drivingcoverstartdate = drivingcoverstartdate; } public String getDrivingclaimagaints() { return drivingclaimagaints; } public void setDrivingclaimagaints(String drivingclaimagaints) { this.drivingclaimagaints = drivingclaimagaints; } public String getDrivingdemeritpoints() { return drivingdemeritpoints; } public void setDrivingdemeritpoints(String drivingdemeritpoints) { this.drivingdemeritpoints = drivingdemeritpoints; } public String getDrivingmodifications() { return drivingmodifications; } public void setDrivingmodifications(String drivingmodifications) { this.drivingmodifications = drivingmodifications; } public String getCarType() { return carType; } public void setCarType(String carType) { this.carType = carType; } public String getTypeOfUse() { return typeOfUse; } public void setTypeOfUse(String typeOfUse) { this.typeOfUse = typeOfUse; } public String getEngineCapacity() { return engineCapacity; } public void setEngineCapacity(String engineCapacity) { this.engineCapacity = engineCapacity; } public String getAmountExcess() { return amountExcess; } public void setAmountExcess(String amountExcess) { this.amountExcess = amountExcess; } public String getQuoterefno() { return quoterefno; } public void setQuoterefno() { String refno = ""; for (int i = 0; i < 8; i++) { refno = refno + ALPHABET.charAt(r.nextInt(ALPHABET.length())); } this.quoterefno = refno; } public String getPremium() { return premium; } public void setPremium() { double finalPremium = 900; int tempage = Integer.parseInt(this.getAge()); String tempcarType = this.carType; int tempengineCapacity = Integer.parseInt(this.engineCapacity) / 1000; String temptypeOfUSe = this.typeOfUse; double tempncd = Double.parseDouble(this.drivingncd); int tempexcess = Integer.parseInt(this.amountExcess);

System.out.println("Default premium = $" + finalPremium);

// Age
if (temp_age <= 20)
{
    finalPremium = finalPremium * 1.6;
}
else if (temp_age > 20 && temp_age <= 25)
{
    finalPremium = finalPremium * 1.4;
}
else if (temp_age > 25 && temp_age <= 30)
{
    finalPremium = finalPremium * 1.2;
}
else if (temp_age > 30)
{
    finalPremium = finalPremium * 1;
}

System.out.println("Age premium = $" + finalPremium);

// Car Type
if (temp_carType.equals("Luxury Sedan"))
{
    finalPremium = finalPremium * 1.5;
}
else if (temp_carType.equals("Sports Car"))
{
    finalPremium = finalPremium * 2;
}
System.out.println("Car Type premium = $" + finalPremium);

// Engine Capacity
if (temp_engineCapacity > 1.6)
{
    double increase = (temp_engineCapacity - 1.6) / 0.1;
    finalPremium = finalPremium * ( 1 + (increase * 0.03));
}

System.out.println("Engine Capacity premium = $" + finalPremium);

// Type of Use
if (temp_typeOfUSe.equals("Company"))
{
    finalPremium = finalPremium * 1.5;
}

System.out.println("Type of Use premium = $" + finalPremium);

// NCD
finalPremium = finalPremium * (1 + temp_ncd);

System.out.println("NCD premium = $" + finalPremium);

// Excess
if (temp_excess > 500 && temp_excess < 1000)
{
    int int_excess = (temp_excess - 500) / 100;
    finalPremium = finalPremium * ( 1 - (int_excess * 0.05));
}

System.out.println("Excess premium = $" + finalPremium);

NumberFormat formatter = new DecimalFormat("#0.00");
this.premium = formatter.format(finalPremium);

} public String getDatesaved() { return datesaved; } public void setDatesaved() { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); this.datesaved = dateFormat.format(calendar.getTime()); } public String insertClientInfo() { String result = ""; try { String sql = "INSERT INTO clientinfo VALUES ('" + this.nric + "','" + this.salutation + "','" + this.familyName + "','" + this.givenName + "','" + this.fullName + "','" + this.dob + "','" + this.gender + "','" + this.age + "','" + this.occupation + "','" + this.maritalStatus + "','" + this.postalCode + "','" + this.emailAddress + "','" + this.carregnum + "','" + this.carmodel + "','" + this.caryearofmake + "','" + this.caroffpeak + "','" + this.drivingyearslicenseheld + "','" + this.drivingncd + "','" + this.drivingcoverstartdate + "','" + this.drivingclaimagaints + "','" + this.drivingdemeritpoints + "','" + this.drivingmodifications + "','" + this.carType + "','" + this.typeOfUse + "','" + this.engineCapacity + "','" + this.amountExcess + "','" + this.quoterefno + "','" + this.premium + "','" + this.date_saved + "')"; System.out.println("SQL: " + sql); Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/novadb?create=true", "root", "mysql"); Statement stat = con.createStatement(); stat.execute(sql); result = "Client info inserted successfully."; } catch (Exception ex) { ex.printStackTrace(); System.out.println(ex); System.out.println("Error."); result = "Client info inserted unsuccessfully."; } return result; }

public ArrayList retrieveDateSaved(String emailAddress) { PreparedStatement stmt = null; ResultSet rs = null; ArrayList dateSavedArray = new ArrayList();

try {
    String sql = "SELECT date_saved FROM client_info WHERE email_address = '" + emailAddress + "' ORDER BY date_saved DESC";
    System.out.println("SQL: " + sql);
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/novadb?create=true", "root", "mysql");
    stmt = con.prepareStatement(sql);
    rs = stmt.executeQuery();

    while (rs.next()) {
        dateSavedArray.add(rs.getString("date_saved"));
        this.dateArray = dateSavedArray;
    }
    System.out.println("date_saved retrieved successfully.");
} catch (Exception ex) {
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println("Error.");
    System.out.println("date_saved retrieved unsuccessfully.");
}
finally {
    try {
        if (stmt != null)
            stmt.close();
    } catch (SQLException e) {
    }
}

System.out.println("dateSavedList.size = " + dateSavedArray.size());
return dateSavedArray;
}
}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
 

 

 

DMCA.com