I l @ ve RuBoard |
This chapter covered a lot of ground, including a quick overview of both JSP and JDBC. JSP files look like Java embedded in HTML, but they end up being turned into HTML embedded in Java. You can find the .java file that was produced from a JSP file in the work subdirectory of Tomcat; you can use these files to help debug errors. JDBC is the connection between JSP and a SQL database. You can use either Statement or PreparedStatement to run a query, depending on whether you will need to rerun it or pass in parameters to the query. Data is returned from a JDBC query in a ResultSet . You also learned that you can get values from an individual row using the getX methods , that executeUpdate allows you to insert, modify, or delete rows from the database. Cursors allow you to modify records as you iterate over a ResultSet . In Chapter 2, "Java Beans and JSP," we go into more depth about JSP, specifically how it can interact with Java Beans to create persistent session data. |
I l @ ve RuBoard |