This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository topia. See http://git.nuiton.org/topia.git commit cd25c6ade5d82c5dfe6deeaae69e08fc52952892 Author: Arnaud Thimel <thimel@codelutin.com> Date: Sat Apr 25 23:47:48 2015 +0200 refs #2892 Keep ToPIA Java 1.6 compatible --- .../nuiton/topia/persistence/jdbc/JdbcHelper.java | 53 ++++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/topia-persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelper.java b/topia-persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelper.java index 56db3b3..5d085a4 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelper.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelper.java @@ -1,5 +1,27 @@ package org.nuiton.topia.persistence.jdbc; +/* + * #%L + * ToPIA :: Persistence + * %% + * Copyright (C) 2004 - 2015 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -10,6 +32,7 @@ import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; /** * @since 3.0 @@ -83,10 +106,34 @@ public class JdbcHelper { return connection; } - protected void closeQuietly(AutoCloseable closeable) { - if (closeable != null) { + protected void closeQuietly(Statement statement) { + if (statement != null) { + try { + statement.close(); + } catch (Exception eee) { + if (log.isWarnEnabled()) { + log.warn("Unable to close: " + eee.getMessage() , eee); + } + } + } + } + + protected void closeQuietly(Connection connection) { + if (connection != null) { + try { + connection.close(); + } catch (Exception eee) { + if (log.isWarnEnabled()) { + log.warn("Unable to close: " + eee.getMessage() , eee); + } + } + } + } + + protected void closeQuietly(ResultSet resultSet) { + if (resultSet != null) { try { - closeable.close(); + resultSet.close(); } catch (Exception eee) { if (log.isWarnEnabled()) { log.warn("Unable to close: " + eee.getMessage() , eee); -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.