public static String execSqlQueryTabular ( @ NotNull final SQLInputs sqlInputs ) throws Exception { ConnectionService connectionService = new ConnectionService ( ) ; try ( final Connection connection = connectionService . setUpConnection ( sqlInputs ) ) { connection . setReadOnly ( true ) ; final Statement statement = connection . createStatement ( sqlInputs . getResultSetType ( ) , sqlInputs . getResultSetConcurrency ( ) ) ; statement . setQueryTimeout ( sqlInputs . getTimeout ( ) ) ; final ResultSet resultSet = statement . executeQuery ( sqlInputs . getSqlCommand ( ) ) ; final String resultSetToTable = Format . resultSetToTable ( resultSet , sqlInputs . isNetcool ( ) ) ; resultSet . close ( ) ; return resultSetToTable ; } }
Run a SQL query with given configuration