CS 318 - Week 8 Lecture - 3-13-13
Intro to JDBC, continued
* we know that the Statement class's executeQuery method
is used to executing SQL that produces tabular results;
* you use a different method, executeUpdate,
for SQL statements that DON'T return tabular
data;
insert, update, deletes, create table, drop table, etc.
* see UpdateLog.java
* METADATA - data about the data --
JDBC provides MANY tools for this
ResultSetMetaData class is a main player here
* see SpewTableColumns.java
* PreparedStatement
* NOTE -- an important weapon in the fight against
SQL Injection...
* when you are doing several similar SQL statements,
a PreparedStatement is a MUCH more efficient choice
than a statement;
* (set-up is done just once, etc.)
* for calling stored procedures and stored functions,
you use a CallableStatement
* see StoredProcCall.java and CallHowMany.java
* also see InOutParam.java for an example of calling a stored
function with IN OUT parameters