![JAR search and dependency download from the Maven repository](/logo.png)
org.nuiton.topia.persistence.jdbc.JdbcHelper2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence Show documentation
Show all versions of persistence Show documentation
ToPIA extension persistence module
package org.nuiton.topia.persistence.jdbc;
/*-
* #%L
* ToPIA Extension :: Persistence
* %%
* Copyright (C) 2018 - 2022 Ultreia.io
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* .
* #L%
*/
import org.nuiton.topia.persistence.TopiaException;
import java.sql.Connection;
import java.util.function.Consumer;
/**
* FIXME: Merge this method with jdbcHelper.
*
* Created by tchemit on 13/05/2018.
*
* @author Tony Chemit - [email protected]
*/
public class JdbcHelper2 extends JdbcHelper {
public JdbcHelper2(JdbcConfiguration jdbcConfiguration) {
super(jdbcConfiguration);
}
public void consume(Consumer consumer) {
try {
try (Connection connection = openConnection()) {
consumer.accept(connection);
}
} catch (Exception e) {
throw new TopiaException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy