Errata
Although we made our best effort to ensure the correctness of all parts of the book, mistakes do happen. This page lists those mistakes that we're aware of along with corrections.
Find an error? Let us know at feedback at eclipsewtp.org
Errata for the second printing, February 2008
There are no known issues with the second printing.
Errata for the first printing, May 2007
Page 79, Example 3.5 Listing of Database.java
Posted July 24, 2007 - Use examples-1.1-20070724.zip or later
Download Database.java | Download Source Code Examples
The try block in this example should read as follows:
try {
Class.forName(DRIVER);
connection = DriverManager.getConnection(URL);
statement = connection.prepareStatement(QUERY);
statement.setString(1, userid);
resultset = statement.executeQuery();
if (resultset.next())
fullname = resultset.getString("FULLNAME").trim();
} catch (Exception e) {
Pages 347-349, Example 8.9 Listing of LeagueFacadeBean.java
Posted Aug 8, 2007 - Use examples-1.1-20070724.zip or later
Download LeagueFacadeBean.java | Download Source Code Examples
The spacing between interface - method and view - type is incorrect.
The correct form for all occurances should be interface-method and view-type
Note that this example is correct in the examples download. The listing should read as follows:
package com.leagueplanet.ejb;
import java.util.Set;
import com.leagueplanet.model.*;
import com.leagueplanet.services.IceHockeyFacade;
import com.leagueplanet.services.LeagueFacade;
/**
* @ejb.bean
* name="LeagueFacade"
* description="An EJB named LeagueFacade"
* display-name="LeagueFacade"
* jndi-name="LeagueFacade"
* type="Stateless"
* transaction-type="Container"
*/
public abstract class LeagueFacadeBean implements
LeagueFacade, javax.ejb.SessionBean {
private LeagueFacade leagueFacade;
/**
* @ejb.interface-method view-type="both"
*/
public boolean createLeague(League newLeague) {
return leagueFacade.createLeague(newLeague);
}
/**
* @ejb.interface-method view-type="both"
*/
public boolean doesLeagueExist(String name) {
return leagueFacade.doesLeagueExist(name);
}
/**
* @ejb.interface-method view-type="both"
*/
public Game findGame(long id) {
return leagueFacade.findGame(id);
}
/**
* @ejb.interface-method view-type="both"
*/
public League findLeague(long id) {
return leagueFacade.findLeague(id);
}
/**
* @ejb.interface-method view-type="both"
*/
public Location findLocation(long id) {
return leagueFacade.findLocation(id);
}
/**
* @ejb.interface-method view-type="both"
*/
public Player findPlayer(long id) {
return leagueFacade.findPlayer(id);
}
/**
* @ejb.interface-method view-type="both"
*/
public Schedule findSchedule(long id) {
return leagueFacade.findSchedule(id);
}
/**
* @ejb.interface-method view-type="both"
*/
public Team findTeam(long id) {
return leagueFacade.findTeam(id);
}
/**
* @ejb.interface-method view-type="both"
*/
public Set getSchedulesForLeague(String league) {
return leagueFacade.getSchedulesForLeague(league);
}
/**
* @ejb.create-method view-type="remote"
*/
public void ejbCreate() {
leagueFacade = IceHockeyFacade.getLeagueFacade();
}
}







