public <T> T execute(final String query, Object connection) {
        try {
            org.apache.cassandra.thrift.Cassandra.Client conn =
                (org.apache.cassandra.thrift.Cassandra.Client) connection;
            conn.set_cql_version(CassandraConstants.CQL_VERSION_3_0);
            KunderaCoreUtils.printQuery(query, showQuery);
            return (T) conn.execute_cql3_query(ByteBuffer.wrap(query.getBytes(Constants.CHARSET_UTF8)),
                Compression.NONE, getConsistencyLevel());
        } catch (Exception e) {
            log.error("Error while executing query {}", query);
            throw new KunderaException(e);
        }
    }
public < T > T execute ( final String query , Object connection ) { try { org . apache . cassandra . thrift . Cassandra . Client conn = ( org . apache . cassandra . thrift . Cassandra . Client ) connection ; conn . set_cql_version ( CassandraConstants . CQL_VERSION_3_0 ) ; KunderaCoreUtils . printQuery ( query , showQuery ) ; return ( T ) conn . execute_cql3_query ( ByteBuffer . wrap ( query . getBytes ( Constants . CHARSET_UTF8 ) ) , Compression . NONE , getConsistencyLevel ( ) ) ; } catch ( Exception e ) { log . error ( "Error while executing query {}" , query ) ; throw new KunderaException ( e ) ; } }
Execute.

@param <T>
the generic type
@param query
the query
@param connection
the connection
@return the t