title: Is it safe to use a static java.sql.Connection instance in a multithreaded system?
body: <p>I'm running a web application on Tomcat. I have a class that handles all DB queries.
  This class contains the <code>Connection</code> object and methods that returns query results.</p>
  
  <p>This is the connection object:</p>
  
  <pre><code>private static Connection conn = null;
  </code></pre>
  
  <p>It has only one instance (singleton).</p>
  
  <p>In addition, I have methods that execute queries, such as search for a user in the db:</p>
  
  <pre><code>public static ResultSet searchUser(String user, String pass) throws SQLException
  </code></pre>
  
  <p>This method uses the static <code>Connection</code> object. My question is, is my use in static <code>Connection</code> object thread safe? Or can it cause problems when a lot of users will call the <code>searchUser</code> method?</p>