title: How to initialize NamedParameterJdbcTemplate variable
body: <p>My code looks like this:</p>
  <pre><code>NamedParameterJdbcTemplate stmt;
  String sql = &quot;INSERT INTO .....&quot;; // &lt;- some insert statement
  Map&lt;String, Object&gt; named = ...;
  ...
  stmt.update(sql, named);
  </code></pre>
  <p>But when I try to compile my program, I'm getting this error message:</p>
  <blockquote>
  <p>variable stmt might not have been initialized</p>
  <p>stmt.update(sql, named);</p>
  <p>^</p>
  <p>1 error</p>
  </blockquote>
  <p>In all examples (like this <a href="http://www.dineshonjava.com/2012/12/using-namedparameterjdbctemplate-in.html#.VjYnVytvDig" rel="nofollow noreferrer">one</a>), that I've seen NamedParameterJdbcTemplate variable was not initialized at all. So, I wonder what I'm doing wrong here.</p>