Java Reference
In-Depth Information
}
}
}
Summary
This chapter discusses improving the efficiency of JDBC-based applications by comparing and
contrasting the three variations on the java.sql.Statement object :
 
java.sql.Statement, which performs in line execution of a SQL command. This approach is
ideal for one-shot execution of a single command, since it involves minimum overhead.
 
java.sql.PreparedStatement, which offers a means of precompiling SQL commands. This
approach is best for executing a command in a loop, since the PreparedStatement passes the
SQL command to the SQL engine where it is parsed, compiled and cached for efficiency and speed
of execution. There is a slight overhead incurred in the precompilation and caching process.
 
java.sql.CallableStatement, which allows you to call SQL stored procedures. This
approach takes advantage of SQL's ability to precompile and store procedures which can
subsequently be executed by name.
Now you know all about inserting basic data types into a database from an HTML form. Chapter 14
discusses inserting and retrieving large objects, such as images and word-processor documents, as
blobs and clobs.
Search WWH ::




Custom Search