|
| |
"Build to Spec!"
Vol. 6, Issue 10, p. 48
Listing 1
public class AccountDAOImpl implements AccountDAO {
public void remove(String id) throws AccountDAODBUpdateException,
AccountDAOSysException {
deleteAccount(id);
}
private void deleteAccount (String userId) throws
AccountDAODBUpdateException,
AccountDAOSysException {
String queryStr = "DELETE FROM ·";
PreparedStatement stmt = null;
Debug.println("queryString is: "+ queryStr);
try {
getDBConnection();
//stmt = dbConnection.createStatement();
//int resultCount = stmt.executeUpdate(queryStr);
stmt = createPreparedStatement(dbConnection, queryStr);
int resultCount = stmt.executeUpdate();
if (resultCount != 1)
throw new AccountDAODBUpdateException
("ERROR deleteing account from ACCOUNT_TABLE!! resultCount = "+
resultCount);
} catch(SQLException se) {
throw new AccountDAOSysException("SQLException while removing " +
"account; id = " + userId + " :\n" + se);
} finally {
closeStatement(stmt);
closeConnection();
}
}
}
Listing 2
<security-role>
<role-name>manager</role-name>
</security-role>
<security-role>
<role-name>everybody</role-name>
</security-role>
<method-permission>
<role-name>manager</role-name>
<method>
<ejb-name>EmployeeService</ejb-name>
<method-intf>Remote</method-intf>
<method-name>setPerformanceRating</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</method>
</method-permission>
<method-permission>
<role-name>everybody</role-name>
<method>
<ejb-name>EmployeeService</ejb-name>
<method-intf>Remote</method-intf>
<method-name>getPerformanceRatingForm</method-name>
<method-params/>
</method>
</method-permission>
|
|
All Rights Reserved
Copyright © 2004 SYS-CON Media, Inc.
E-mail: info@sys-con.com
Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.
|