原书出处
发布!设计与部署稳定的分布式系统(第2版)
02 案例研究:让航空公司停飞的代码异常
public class FlightSearch implements SessionBean { private MonitoredDataSource connectionPool; public List lookupByCity(. . .) throws SQLException, RemoteException { Connection conn = null; Statement stmt = null; try { conn = connectionPool.getConnection(); stmt = conn.createStatement(); // 执行查询逻辑 // 返回结果列表 } finally { if (stmt != null) { stmt.close(); } if (conn != null) { conn.close(); } } } } 这个方法乍一看写得不错。
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/发布!设计与部署稳定的分布式系统(第2版)/_epub-src/OEBPS/Text/epub_0009.html
EPUB SHA-256:635287f58d5faa3bf4663b7054bb04bf1dae21c038cdb557e0ec642ecdc68587