JDBC Recipes, First Edition, by Mahmoud Parsian

This errata page lists errors outstanding in the First Edition printing.

This page was updated April 11, 2006.

If you have technical JDBC questions or error reports, you can send them to admin@jdbccookbook.com. Please specify the printing date of your copy.

Many thanks for the errata submitters!

Here's a key to the markup:


	[page-number]: serious technical mistake
	{page-number}: minor technical mistake
	<page-number>: important language/formatting problem
	(page-number): language change or minor formatting problem
	?page-number?: reader question or request for clarification

Confirmed errors:


Errata: <60>

Submitter Name: Jeanne Boyarsky

Submitter Email: nyjeanne@gmail.com

Submission Date: 2005-11-27

Errata Description: On page 60 (in ch 2), the section titled "batch multiple update statements using java.sql.CallableStatement" is inconsistent. It first says you may not have IN or INOUT parameters. Then, in step 3, it says to indicate which parameters are INOUT parameters.

Explanation:

  • Page 60 indicates that stored procedures invoked using the batch update may not have IN or OUT parameters.
  • Then page 61, lists the GENERAL steps (steps 1-6) for invoking a stored procedure, but the paragraph following step 6 indicates: "please note that for batch updates, steps 3, 5, and 6 are not required" . Note that step 3 is for registering output parameters.
  • These two steps are consistent (meaning that stored procedures invoked using the batch update may not have IN or OUT parameters.
  • If you have any question about my book/JDBC, please let me know.
    Errata: <200>

    Submitter Name: Jeanne Boyarsky

    Submitter Email: nyjeanne@gmail.com

    Submission Date: 2005-11-27

    Errata Description: On page 200, section 5-26 is a bunch of examples using "like." The second example is "pat%". The comment says "ends with the word pat", but is should be "starts with the word pat".

    Correction: Replace "ends with the word pat" by "starts with the word pat".


    Errata: [325]

    Submitter Name: Jeanne Boyarsky

    Submitter Email: nyjeanne@gmail.com

    Submission Date: 2005-11-27

    Errata Description: On page 325, section 9-23 has a code example with an if statement. The { is missing for the if statement.

    Correction: Inside the toTimeString() method,
    replace

    
       if (date == null)
          return null;
       }
    
    
    with
    
       if (date == null) {
          return null;
       }
    
    

    Errata: {95}

    Submitter Name: Oliver Shi

    Submitter Email: shiliang@liandisys.com.cn

    Submission Date: 2007-03-15

    Errata Description: On page 95, variable name is misused.

    Correction: replace

    
       java.util.Properties dbProperties  = new java.util.Properties();
       jdbcProperties.put(DATABASE_USR, dbUserName );
       jdbcProperties.put(DATABASE_ PASSWORD, dbPass);
    
    
    with
    
      java.util.Properties dbProperties  = new java.util.Properties();
      dbProperties.put(DATABASE_USR, dbUserName );
      dbProperties.put(DATABASE_ PASSWORD, dbPass);
    
    

    Errata: {236}

    Submitter Name: Robin Twombly

    Submitter Email: Robin.Twombly@gmail.com

    Submission Date: 2007-03-01

    Errata Description: On page 236,

    Correction: replace the following line:

    
       long length;
    
    
    with
    
       int length = 1024;
    
    

    Errata: {237}

    Submitter Name: harihara sudhan

    Submitter Email: hariswengg@gmail.com

    Submission Date: 2010-05-01

    Errata Description: On page 237 (and any page using DatabaseUtil.trimArgument() method),

    Correction: add the following method to the DatabaseUtil.java:

    
    
    public static String trimArgument(String str) {
        if (str == null) {
            return str;
        }
        else {
            return str.trim();
        }
    }