title: Inserting auto generated id in sqllite using java
body: <p>I am writing java application using sqllite </p>
  
  <pre><code>public Product createProduct(String productName) throws SQLException {
      String query = "INSERT into tbl_Product (name) values (?) ";
      PreparedStatement preparedStatement = null;
      Connection connection = null;
      ResultSet rs = null;
      Product product = null;
      try {
          connection = ConnectionFactory.getConnection();
          preparedStatement = connection.prepareStatement(query);
          //preStatement.setInt(1, 0);
          preparedStatement.setString(1, productName);
          preparedStatement.executeUpdate();
  
      } finally {
  
          //preparedStatement.close();
          DbUtil.close(rs);
          DbUtil.close(preparedStatement);
          DbUtil.close(connection);
      }
      return product;
  
  }
  </code></pre>
  
  <p>My product table have (ID,Name) column, where Id is auto generated. What all java changes are required so that preStatement can insert auto generated id in db.</p>