Author: ojacobson
Date: Tue Jun 30 10:29:48 2009
New Revision: 4453
Log:
A few more interposing statements moved out from between resource aquisition and
try.
Modified:
congo/branches/congo-2.0.0.2/src/main/java/com/stonekeep/congo/dao/PropertyDAO.j\
ava
Modified:
congo/branches/congo-2.0.0.2/src/main/java/com/stonekeep/congo/dao/PropertyDAO.j\
ava
==============================================================================
---
congo/branches/congo-2.0.0.2/src/main/java/com/stonekeep/congo/dao/PropertyDAO.j\
ava [iso-8859-1] (original)
+++
congo/branches/congo-2.0.0.2/src/main/java/com/stonekeep/congo/dao/PropertyDAO.j\
ava [iso-8859-1] Tue Jun 30 10:29:48 2009
@@ -214,9 +214,9 @@
}
public void updatePropertyConfiguration(PropertyConfiguration pc) throws
SQLException {
- Connection c = dataSource.getConnection();
- PreparedStatement p;
- logger.debug("Update: Using " + SQL_UPDATE_PROPERTYCONFIGURATION);
+ PreparedStatement p;
+ logger.debug("Update: Using " + SQL_UPDATE_PROPERTYCONFIGURATION);
+ Connection c = dataSource.getConnection();
try {
p = c.prepareStatement(SQL_UPDATE_PROPERTYCONFIGURATION);
p.setString(1,pc.defaultvalue);
@@ -250,9 +250,9 @@
public PropertyConfiguration getPropertyConfiguration(int cid, String name)
throws SQLException {
logger.debug("Loading PropertyConfiguration '" + name + "' for con " + cid);
- Connection c = dataSource.getConnection();
- PreparedStatement p;
PropertyConfiguration pc = new PropertyConfiguration();
+ PreparedStatement p;
+ Connection c = dataSource.getConnection();
try {
p = c.prepareStatement(SQL_SELECT_PROPERTYCONFIGURATION);
p.setInt(1,cid);