compile 'ch.qos.logback:logback-classic'
compile 'ch.qos.logback:logback-core'
compile 'com.google.guava:guava'
- compile 'commons-dbutils:commons-dbutils'
compile 'commons-io:commons-io'
compile 'commons-lang:commons-lang'
compile 'org.apache.commons:commons-dbcp2'
testRuntime 'com.oracle.jdbc:ojdbc8'
testRuntime 'org.postgresql:postgresql'
+ testFixturesApi 'commons-dbutils:commons-dbutils'
testFixturesApi 'junit:junit'
testFixturesApi 'org.assertj:assertj-core'
import javax.sql.DataSource;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.BasicDataSourceFactory;
-import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.log.Logger;
} catch (SQLException e) {
throw new IllegalStateException("Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').", e);
} finally {
- DbUtils.closeQuietly(connection);
+ DatabaseUtils.closeQuietly(connection);
}
}
import java.sql.SQLException;
import java.util.Iterator;
import java.util.NoSuchElementException;
-import org.apache.commons.dbutils.DbUtils;
/**
* Forward-only {@link java.util.Iterator} over a {@link java.sql.ResultSet}. Rows are
@Override
public void close() {
closed = true;
- DbUtils.closeQuietly(rs);
- DbUtils.closeQuietly(stmt);
+ DatabaseUtils.closeQuietly(rs);
+ DatabaseUtils.closeQuietly(stmt);
}
protected abstract E read(ResultSet rs) throws SQLException;
compile 'com.google.guava:guava'
compile 'com.google.protobuf:protobuf-java'
- compile 'commons-dbutils:commons-dbutils'
compile 'commons-io:commons-io'
compile 'commons-lang:commons-lang'
compile 'net.jpountz.lz4:lz4'
compileOnly 'com.google.code.findbugs:jsr305'
testCompile 'com.tngtech.java:junit-dataprovider'
+ testCompile 'commons-dbutils:commons-dbutils'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.assertj:assertj-guava'
import java.util.List;
import java.util.function.Consumer;
import javax.annotation.CheckForNull;
-import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.io.IOUtils;
import org.apache.ibatis.session.ResultHandler;
import org.sonar.db.Dao;
+import org.sonar.db.DatabaseUtils;
import org.sonar.db.DbSession;
import static org.sonar.db.DatabaseUtils.toUniqueAndSortedPartitions;
} catch (SQLException e) {
throw new IllegalStateException("Fail to read FILE_SOURCES.LINE_HASHES of file " + fileUuid, e);
} finally {
- DbUtils.closeQuietly(connection, pstmt, rs);
+ DatabaseUtils.closeQuietly(rs);
+ DatabaseUtils.closeQuietly(pstmt);
+ DatabaseUtils.closeQuietly(connection);
}
}
throw new IllegalStateException("Fail to read FILE_SOURCES.LINE_HASHES of file " + fileUuid, e);
} finally {
IOUtils.closeQuietly(reader);
- DbUtils.closeQuietly(connection, pstmt, rs);
+ DatabaseUtils.closeQuietly(rs);
+ DatabaseUtils.closeQuietly(pstmt);
+ DatabaseUtils.closeQuietly(connection);
}
}
import java.sql.SQLException;
import java.util.List;
import javax.sql.DataSource;
-import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.io.output.NullWriter;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.jdbc.ScriptRunner;
} catch (SQLException e) {
throw new IllegalStateException("Fail to create schema", e);
} finally {
- DbUtils.closeQuietly(connection);
+ DatabaseUtils.closeQuietly(connection);
}
}
compile 'commons-lang:commons-lang'
compile 'commons-codec:commons-codec'
compile 'org.picocontainer:picocontainer'
- compile 'commons-dbutils:commons-dbutils'
compile project(':server:sonar-db-core')
compile project(':server:sonar-process')
testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.tngtech.java:junit-dataprovider'
+ testCompile 'commons-dbutils:commons-dbutils'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mindrot:jbcrypt'
import java.sql.Types;
import java.util.Date;
import javax.annotation.Nullable;
-import org.apache.commons.dbutils.DbUtils;
+import org.sonar.db.DatabaseUtils;
class BaseSqlStatement<CHILD extends SqlStatement> implements SqlStatement<CHILD> {
protected PreparedStatement pstmt;
@Override
public void close() {
- DbUtils.closeQuietly(pstmt);
+ DatabaseUtils.closeQuietly(pstmt);
pstmt = null;
}
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.dbutils.DbUtils;
import org.sonar.db.Database;
+import org.sonar.db.DatabaseUtils;
public class SelectImpl extends BaseSqlStatement<Select> implements Select {
} catch (Exception e) {
throw newExceptionWithRowDetails(row, e);
} finally {
- DbUtils.closeQuietly(rs);
+ DatabaseUtils.closeQuietly(rs);
close();
}
}
} catch (Exception e) {
throw newExceptionWithRowDetails(row, e);
} finally {
- DbUtils.closeQuietly(rs);
+ DatabaseUtils.closeQuietly(rs);
close();
}
}
} catch (Exception e) {
throw newExceptionWithRowDetails(row, e);
} finally {
- DbUtils.closeQuietly(rs);
+ DatabaseUtils.closeQuietly(rs);
close();
}
}
compile 'ch.qos.logback:logback-core'
compile 'com.google.code.gson:gson'
compile 'com.google.protobuf:protobuf-java'
- compile 'commons-dbutils:commons-dbutils'
compile 'io.jsonwebtoken:jjwt-api'
compile 'io.jsonwebtoken:jjwt-impl'
compile 'org.apache.httpcomponents:httpclient'
testCompile 'com.h2database:h2'
testCompile 'com.squareup.okhttp3:mockwebserver'
testCompile 'com.tngtech.java:junit-dataprovider'
+ testCompile 'commons-dbutils:commons-dbutils'
testCompile 'org.apache.logging.log4j:log4j-api'
testCompile 'org.apache.logging.log4j:log4j-core'
testCompile 'org.assertj:assertj-core'