Hi Chris,
The
JDBC code you're using is at a lower level than ColdFusion tags. It gives you a lot more control over how you interact with the database. Consequently it requires more code to do the simple things. ColdFusion is akin to the tags provided by JSTL or
Struts. These technologies do the simpler things very succinctly, further hiding the complexity behind the scenes from the developer. In simple terms a loop is required as your ResultSet returns more than one row.
Your second question is more difficult. Your JDBC driver has given you a ResultSet of ResultSet.TYPE_FORWARD_ONLY, which suggests only JDBC 1.0 support. JDBC 2.0 introduced scrollable ResultSets which support the first() and last() methods, etc. Calling rs.first() on a forward-only ResultSet has no effect, hence the ResultSet still points at the last record found by rs.next().
Hope that helps. As you appear to crave a full understanding of these concepts I suggest you have a good browse through the API documentation for the java.sql package on Sun's website and also study the JDBC 2.0 tutorial there.
Jules