com.sap.cloud.mt.runtime.ConnectionChecker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multi-tenant-runtime Show documentation
Show all versions of multi-tenant-runtime Show documentation
Spring Boot Enablement Parent
/******************************************************************************
* © 2020 SAP SE or an SAP affiliate company. All rights reserved. *
******************************************************************************/
package com.sap.cloud.mt.runtime;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
@Deprecated
public class ConnectionChecker {
public void checkConnection(String tenantId, DataSource dataSource, String dummySelectStatement) throws SQLException {
try (TenantOverwrite overwrite = new TenantOverwrite(tenantId);
Connection connection = dataSource.getConnection();
Statement statement = connection.createStatement()) {
if (dummySelectStatement != null && !dummySelectStatement.trim().isEmpty())
statement.execute(dummySelectStatement);
else statement.execute("select 1 as a from dummy");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy