Regarding term clarification in the database api So I was making a custom block, and implemented the build() method. 

public function build() {
    $result = $connection-&gt;db_query("SELECT n.title, u.uid, n.created    FROM node_field_data n, users u WHERE u.uid = n.uid AND n.type = :type ORDER BY n.created DESC LIMIT 5", array(
        'type' =&gt; 'article',
    ));
    $content = '';
    if ($result) {
        while ($row = $result-&gt;fetchAssoc()) {
            $content .= '&lt;li&gt;' . $row['title'] . '&lt;/li&gt;';
        }
    } else {
        $content .= 'No blog posts to show';
    }

    return array(
        '#markup' =&gt; '&lt;ul&gt;' . $content . '&lt;/ul&gt;',
    );
}


So this is a pretty basic helloworld kind of example calling the database. But db_query is deprecated with the following surgestion:

     * @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
     *   a database connection injected into your service from the container and
     *   call query() on it. E.g.
     *   $injected_database-&gt;query($query, $args, $options);


The surgestion seemed kind of spacey not entirely knowing all of the expressions but i eventually fixed it with the following code:

    $connection = \Drupal::database();
    $result = $connection-&gt;query("SELECT n.title, u.uid, n.created FROM node_field_data n, users u WHERE u.uid = n.uid AND n.type = :type ORDER BY n.created DESC LIMIT 5", array(
        'type' =&gt; 'article',
    ));


to call the database. 

My question is, \Drupal::database() is a static method, and i call it from inside of my own block, am i doing it wrong? or am i misunderstanding their meaning of dependency injection? if i had to do DI in other web programming i would find the DI container and configure it to give the database into my constructor or via a accessor method right? 

Follow up questions is  


What exactly constitutes my container?
What is "my service" referring to?  my module maybe?
Yes, you are doing it wrong by calling \Drupal::database.

Look at Drupal\block_content\Plugin\Block\BlockContentBlock in core as an example. The create() method gets the services and passes them to the __construct() method. That is the proper way.