org.kawanfw.sql.servlet.SqlConfiguratorCall Maven / Gradle / Ivy
/*
* This file is part of AceQL.
* AceQL: Remote JDBC access over HTTP.
* Copyright (C) 2015, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* AceQL 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 2.1 of the License, or (at your option) any later version.
*
* AceQL 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*
* Any modifications to this file must keep this entire header
* intact.
*/
package org.kawanfw.sql.servlet;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import org.kawanfw.sql.api.server.SqlConfigurator;
/**
*
* Calls SqlConfigurator methods using reflection
*
* @author Nicolas de Pomereu
*
*/
public class SqlConfiguratorCall {
/**
* Returns the result of SqlConfigurator.allowExecute
*
* @param sqlConfigurator
* the SqlConfigurator instance
* @param username
* the client username
* @param connection
* The JDBC Connection
* @return the result of SqlConfigurator.allowExecute
* @throws IOException
* @throws SQLException
*/
public static boolean allowExecute(SqlConfigurator sqlConfigurator,
String username, Connection connection) throws IOException,
SQLException {
return sqlConfigurator.allowExecute(username, connection);
}
/**
* Returns the result of SqlConfigurator.allowExecuteUpdate
*
* @param sqlConfigurator
* the SqlConfigurator instance
* @param username
* the client username
* @param connection
* The JDBC Connection
* @return the result of SqlConfigurator.allowExecuteUpdate
* @throws IOException
* @throws SQLException
*/
public static boolean allowExecuteUpdate(SqlConfigurator sqlConfigurator,
String username, Connection connection) throws IOException,
SQLException {
return sqlConfigurator.allowExecuteUpdate(username, connection);
}
/**
* Returns the result of SqlConfigurator.allowStatementClass
*
* @param sqlConfigurator
* the SqlConfigurator instance
* @param username
* the client username
* @param connection
* The JDBC Connection
* @return the result of SqlConfigurator.allowStatementClass
* @throws IOException
* @throws SQLException
*/
public static boolean allowStatementClass(SqlConfigurator sqlConfigurator,
String username, Connection connection) throws IOException,
SQLException {
return sqlConfigurator.allowStatementClass(username, connection);
}
/**
* Returns the result of SqlConfigurator.allowGetMetaData
*
* @param sqlConfigurator
* the SqlConfigurator instance
* @param username
* the client username
* @param connection
* The JDBC Connection
* @return the result of SqlConfigurator.allowGetMetaData
* @throws IOException
* @throws SQLException
*/
public static boolean allowGetMetaData(SqlConfigurator sqlConfigurator,
String username, Connection connection) throws IOException,
SQLException {
return sqlConfigurator.allowGetMetaData(username, connection);
}
/**
* Returns the result of SqlConfigurator.allowResultSetGetMetaData
*
* @param sqlConfigurator
* the SqlConfigurator instance
* @param username
* the client username
* @param connection
* The JDBC Connection
* @return the result of SqlConfigurator.allowResultSetGetMetaData
* @throws IOException
* @throws SQLException
*/
public static boolean allowResultSetGetMetaData(
SqlConfigurator sqlConfigurator, String username,
Connection connection) throws IOException, SQLException {
return sqlConfigurator.allowResultSetGetMetaData(username, connection);
}
/*
* public void runIfStatementRefused(String username, Connection connection,
* String ipAddress, String sql, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy