unreported exception java.sql.SQLException; must be caught or thrown
<pre><code>import java.beans.Statement;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class Collect extends HttpServlet {


private String getParameter(String string) {
    throw new UnsupportedOperationException("Not yet implemented");
}


public void didGet(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;

    res.setContentType("text/html");
    PrintWriter out = res.getWriter();


    try {
        // Load (and therefore register) the Oracle Driver
        Class.forName("oracle.jdbc.driver.OracleDriver");

        // Get a Connection to the database
        con = DriverManager.getConnection(
                "jdbc:oracle:thin:@dbhost:1528:ORCL", "root", "project366");

    } catch (ClassNotFoundException e) {
        out.println("Couldn't load database driver: " + e.getMessage());
    } catch (SQLException e) {
        out.println("SQLException caught: " + e.getMessage());
    } finally {
        // Always close the database connection.
        try {
            if (con != null) {
                con.close();
            }
        } catch (SQLException ignored) {
            out.println(ignored);
        }
    }

    String brand = getParameter("ItemBrand");
    String category = getParameter("");
    String name = getParameter("ItemName");
    String model = getParameter("ModelNumber");
    String owner = getParameter("OwnerName");
    String creator = getParameter("");
    String collectability = getParameter("Rarity");
    String year = getParameter("ItemYear");
    String description = getParameter("ItemDesc");
    String subname = getParameter("ItemSubtitle");
    String series = getParameter("ItemSeries");
    String worth = getParameter("ItemValue");
    String haveCondition = getParameter("HaveQuality");
    String desiredCondition = getParameter("DesiredQuality");
    String owned = getParameter("WantButton");

    if (owned.equals("a10")) {
        try {
            //Load the Driver   
            Class.forName("org.apache.derby.jdbc.ClientDriver");
            //Get a Connection to the database
            con = DriverManager.getConnection("jdbc:derby://localhost:1527/CollectionDB", "root", "project366");

            //ADD DATA TO DATABASE
            String collectableString = "INSERT INTO COLLECTABLE VALUES(?,?)";
            String ownedString = "INSERT INTO ITEM_OWNED VALUES(?,?,?,?,?)";
            String qualitiesString = "INSERT INTO QUALITIES_OWNED VALUES(?,?,?,?,?,?,?,?)";
            String valueString = "INSERT INTO ITEM_VALUE VALUES(?,?,?,?,?,?)";

            PreparedStatement pstC = con.prepareStatement(collectableString);
            pstC.setString(1, brand);
            pstC.setString(2, category);

            PreparedStatement pstO = con.prepareStatement(ownedString);
            pstO.setString(1, name);
            pstO.setString(2, model);
            pstO.setString(3, owner);
            pstO.setString(4, brand);
            pstO.setString(5, creator);

            PreparedStatement pstQ = con.prepareStatement(qualitiesString);
            pstQ.setString(1, collectability);
            pstQ.setString(2, name);
            pstQ.setString(3, model);
            pstQ.setString(4, owner);
            pstQ.setString(5, year);
            pstQ.setString(6, description);
            pstQ.setString(7, subname);
            pstQ.setString(8, series);

            PreparedStatement pstV = con.prepareStatement(valueString);
            pstV.setString(1, collectability);
            pstV.setString(2, name);
            pstV.setString(3, model);
            pstV.setString(4, owner);
            pstV.setString(5, haveCondition);
            pstV.setString(6, worth);

            pstC.executeUpdate();
            pstO.executeUpdate();
            pstQ.executeUpdate();
            pstV.executeUpdate();
            pstC.close();
            pstO.close();
            pstQ.close();
            pstV.close();
        } catch (ClassNotFoundException e) {
            out.println("Couldn't load database driver: " + e.getMessage());
        } catch (SQLException e) {
            out.println("SQLException caught: " + e.getMessage());
        } catch (Exception e) {
            out.println(e);
        } finally {
            try {
                if (con != null) {
                    con.close();
                }
            } catch (SQLException ignored) {
                out.println(ignored);
            }
        }


        try {
            String collectableView = "SELECT * FROM COLLECTABLE";
            String ownedView = "SELECT * FROM ITEM_OWNED";
            String qualitiesView = "SELECT * FROM QUALITIES_OWNED";
            String valueView = "SELECT * FROM ITEM_VALUE";
            String cView = con.executeSQLQuery(collectableView);
            String oView = con.executeSQLQuery(ownedView);
            String qView = con.executeSQLQuery(qualitiesView);
            String vView = con.executeSQLQuery(valueView);
            //TODO output your page here
            out.println("&lt;html&gt;");
            out.println("&lt;head&gt;");
            out.println("&lt;title&gt;Your Data has been saved&lt;/title&gt;");
            out.println("&lt;/head&gt;");
            out.println("&lt;body&gt;");
            //out.println("&lt;h1&gt;Servlet Collect at " + request.getContextPath () + "&lt;/h1&gt;");
            out.println("&lt;p&gt;Collectable Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + cView.executeQuery(collectableView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Item Owned Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + oView.executeQuery(ownedView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Qualities Owned Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + qView.executeQuery(qualitiesView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Item Value&lt;/p&gt;");
            out.println("&lt;p&gt;" + vView.executeQuery(valueView) + "&lt;/p&gt;");
            out.println("&lt;/body&gt;");
            out.println("&lt;/html&gt;");


        } finally {
            out.close();
        }
    } else if (owned.equals("a20")) {
        try {
            //Load the Driver   
            Class.forName("org.apache.derby.jdbc.ClientDriver");
            //Get a Connection to the database
            con = DriverManager.getConnection("jdbc:derby://localhost:1527/CollectionDB", "root", "project366");

            //ADD DATA TO DATABASE
            String collectableString = "INSERT INTO COLLECTABLE VALUES(?,?)";
            String desiredString = "INSERT INTO ITEM_DESIRED VALUES(?,?,?,?)";
            String qualityWantString = "INSERT INTO QUALITIES DESIRED VALUES(?,?,?,?,?,?,?,?)";

            PreparedStatement pstC = con.prepareStatement(collectableString);
            pstC.setString(1, brand);
            pstC.setString(2, category);

            PreparedStatement pstD = con.prepareStatement(desiredString);
            pstD.setString(1, name);
            pstD.setString(2, model);
            pstD.setString(3, owner);
            pstD.setString(4, brand);

            PreparedStatement pstW = con.prepareStatement(qualityWantString);
            pstW.setString(1, name);
            pstW.setString(2, model);
            pstW.setString(3, owner);
            pstW.setString(4, year);
            pstW.setString(5, description);
            pstW.setString(6, subname);
            pstW.setString(7, series);
            pstW.setString(8, worth);

            pstC.executeUpdate();
            pstD.executeUpdate();
            pstW.executeUpdate();
            pstC.close();
            pstD.close();
            pstW.close();
        } catch (ClassNotFoundException e) {
            out.println("Couldn't load database driver: " + e.getMessage());
        } catch (SQLException e) {
            out.println("SQLException caught: " + e.getMessage());
        } catch (Exception e) {
            out.println(e);
        } finally {
            try {
                if (con != null) {
                    con.close();
                }
            } catch (SQLException ignored) {
                out.println(ignored);
            }
        }

        try {
            String collectableView = "SELECT * FROM COLLECTABLE";
            String desiredView = "SELECT * FROM ITEM_DESIRED";
            String qWantView = "SELECT * FROM QUALITIES DESIRED";
            PreparedStatement cView = con.prepareStatement(collectableView);
            PreparedStatement dView = con.prepareStatement(desiredView);
            PreparedStatement qView = con.prepareStatement(qWantView);
            //TODO output your page here
            out.println("&lt;html&gt;");
            out.println("&lt;head&gt;");
            out.println("&lt;title&gt;Your Data has been saved&lt;/title&gt;");
            out.println("&lt;/head&gt;");
            out.println("&lt;body&gt;");
            //out.println("&lt;h1&gt;Servlet Collect at " + request.getContextPath () + "&lt;/h1&gt;");
            out.println("&lt;p&gt;Collectable Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + cView.executeQuery(collectableView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Item Desired Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + dView.executeQuery(desiredView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Qualities Desired Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + qView.executeQuery(qWantView) + "&lt;/p&gt;");
            out.println("&lt;/body&gt;");
            out.println("&lt;/html&gt;");
            cView.close();
            dView.close();
            qView.close();

        } finally {
            out.close();
        }
    }

}

// &lt;editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."&gt;
/** 
 * Handles the HTTP &lt;code&gt;GET&lt;/code&gt; method.
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    processRequest(request, response);
}

/** 
 * Handles the HTTP &lt;code&gt;POST&lt;/code&gt; method.
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
   // processRequest(request, response);
}

/** 
 * Returns a short description of the servlet.
 * @return a String containing servlet description
 */
@Override
public String getServletInfo() {
    return "Short description";
}// &lt;/editor-fold&gt;

private void processRequest(HttpServletRequest request, HttpServletResponse response) {
    //throw new UnsupportedOperationException("Not yet implemented");
}
</code></pre>

<p>}</p>

<p>So my problem is that I can't seem to get rid of the errors in here</p>

<pre><code>try {
            String collectableView = "SELECT * FROM COLLECTABLE";
            String ownedView = "SELECT * FROM ITEM_OWNED";
            String qualitiesView = "SELECT * FROM QUALITIES_OWNED";
            String valueView = "SELECT * FROM ITEM_VALUE";
            String cView = con.executeSQLQuery(collectableView);
            String oView = con.executeSQLQuery(ownedView);
            String qView = con.executeSQLQuery(qualitiesView);
            String vView = con.executeSQLQuery(valueView);
            //TODO output your page here
            out.println("&lt;html&gt;");
            out.println("&lt;head&gt;");
            out.println("&lt;title&gt;Your Data has been saved&lt;/title&gt;");
            out.println("&lt;/head&gt;");
            out.println("&lt;body&gt;");
            //out.println("&lt;h1&gt;Servlet Collect at " + request.getContextPath () + "&lt;/h1&gt;");
            out.println("&lt;p&gt;Collectable Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + cView.executeQuery(collectableView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Item Owned Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + oView.executeQuery(ownedView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Qualities Owned Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + qView.executeQuery(qualitiesView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Item Value&lt;/p&gt;");
            out.println("&lt;p&gt;" + vView.executeQuery(valueView) + "&lt;/p&gt;");
            out.println("&lt;/body&gt;");
            out.println("&lt;/html&gt;");


        } finally {
            out.close();
        }
    } else if (owned.equals("a20")) {
        try {
            //Load the Driver   
            Class.forName("org.apache.derby.jdbc.ClientDriver");
            //Get a Connection to the database
            con = DriverManager.getConnection("jdbc:derby://localhost:1527/CollectionDB", "root", "project366");

            //ADD DATA TO DATABASE
            String collectableString = "INSERT INTO COLLECTABLE VALUES(?,?)";
            String desiredString = "INSERT INTO ITEM_DESIRED VALUES(?,?,?,?)";
            String qualityWantString = "INSERT INTO QUALITIES DESIRED VALUES(?,?,?,?,?,?,?,?)";

            PreparedStatement pstC = con.prepareStatement(collectableString);
            pstC.setString(1, brand);
            pstC.setString(2, category);

            PreparedStatement pstD = con.prepareStatement(desiredString);
            pstD.setString(1, name);
            pstD.setString(2, model);
            pstD.setString(3, owner);
            pstD.setString(4, brand);

            PreparedStatement pstW = con.prepareStatement(qualityWantString);
            pstW.setString(1, name);
            pstW.setString(2, model);
            pstW.setString(3, owner);
            pstW.setString(4, year);
            pstW.setString(5, description);
            pstW.setString(6, subname);
            pstW.setString(7, series);
            pstW.setString(8, worth);

            pstC.executeUpdate();
            pstD.executeUpdate();
            pstW.executeUpdate();
            pstC.close();
            pstD.close();
            pstW.close();
        } catch (ClassNotFoundException e) {
            out.println("Couldn't load database driver: " + e.getMessage());
        } catch (SQLException e) {
            out.println("SQLException caught: " + e.getMessage());
        } catch (Exception e) {
            out.println(e);
        } finally {
            try {
                if (con != null) {
                    con.close();
                }
            } catch (SQLException ignored) {
                out.println(ignored);
            }
        }

        try {
            String collectableView = "SELECT * FROM COLLECTABLE";
            String desiredView = "SELECT * FROM ITEM_DESIRED";
            String qWantView = "SELECT * FROM QUALITIES DESIRED";
            PreparedStatement cView = con.prepareStatement(collectableView);
            PreparedStatement dView = con.prepareStatement(desiredView);
            PreparedStatement qView = con.prepareStatement(qWantView);
            //TODO output your page here
            out.println("&lt;html&gt;");
            out.println("&lt;head&gt;");
            out.println("&lt;title&gt;Your Data has been saved&lt;/title&gt;");
            out.println("&lt;/head&gt;");
            out.println("&lt;body&gt;");
            //out.println("&lt;h1&gt;Servlet Collect at " + request.getContextPath () + "&lt;/h1&gt;");
            out.println("&lt;p&gt;Collectable Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + cView.executeQuery(collectableView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Item Desired Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + dView.executeQuery(desiredView) + "&lt;/p&gt;");
            out.println("&lt;p&gt;Qualities Desired Table&lt;/p&gt;");
            out.println("&lt;p&gt;" + qView.executeQuery(qWantView) + "&lt;/p&gt;");
            out.println("&lt;/body&gt;");
            out.println("&lt;/html&gt;");
            cView.close();
            dView.close();
            qView.close();

        } finally {
            out.close();
        }
    }

}
</code></pre>

<p>I get an error that says </p>

<blockquote>
  <p>unreported exception java.sql.SQLException; must be caught or thrown. </p>
</blockquote>

<p>My group and I have tried several different ways to "fix" this and as you can tell nothing has changed. Any help will be very much appreciated and I will try to answer any question to the best of my ability. We are using Netbeans 7.0.1 on Debian and using Apache Tomcat 7.0.14.0. </p>

<p>Edit: Sorry, was away. Thanks for all of the tips. We have it down to just eight errors now (All dealing with the same thing). They happen at </p>

<pre><code>String cView = con.executeSQLQuery(collectableView);
            String oView = con.executeSQLQuery(ownedView);
            String qView = con.executeSQLQuery(qualitiesView);
            String vView = con.executeSQLQuery(valueView);
</code></pre>

<p>All of the executeSQLQuery(owned/qualties/value) are underlined and say 
    cannot find symbol
    symbol: method executeQuery(java.lang.String)
    location:variable oView of type java.lang.String</p>
