title: Servlets with Database design
body: <p>I have a general question about using Servlet and JDBC. </p>
  
  <p>For instance, I have a class called MyDatabaseManager, which provides functions</p>
  
  <pre>
  public boolean updateUser(User user) {...}
  public boolean deleteUser(User user) {...}
  public boolean inserUser(User user){...}
  </pre>
  
  <p>, these functions will access and manipulate the Database.</p>
  
  <p>My question is on the Servlet implementation. I am using three Servlets (UpdateUserServlet,InsertUserServlet and DeleteUserServlet) at the moment and each Servlet calls the MyDatabaseManager instance (only one instance here, using Singleton pattern) function. (For example, UpdateUserServlet calls MyDatabaseManager.updateUser ...). </p>
  
  <p>I think this is the most straightforward way of using Servlet and Database. But I am not sure if this is the correct way of doing it. For example, how is this implemented in the industry world.</p>