title: Primary key not unique in SQLLite with AutoIncrement
body: <p>I've created a table with an autoincrement primary key:</p>
  
  <pre><code>String sql = "CREATE TABLE COMPANY " + "(ID INTEGER PRIMARY KEY AUTOINCREMENT," + " NAME TEXT NOT NULL)" 
  </code></pre>
  
  <p>Next, I want to add a record to my database.</p>
  
  <p>However, when I run program I get the message:</p>
  
  <blockquote>
    <p>A PRIMARY KEY constraint failed (UNIQUE constraint failed: COMPANY.ID).</p>
  </blockquote>
  
  <p>Any ideas how I can auto increment a record number? I'm not editing existing records I'm adding a record.  To insert into company values I used the term "active" in the ID field.</p>
  
  <pre><code>public class Main {
  
      public static void main(String[] args) {
          String nam;
          int ag;
          Scanner key = new Scanner(System.in);
          System.out.println("\nEnter your name : ");
          nam = key.next();
          System.out.println("\nEnter your age : ");
          ag = key.nextInt();
  
  
          Connection c = null;
          Statement stmt = null;
          try {
              Class.forName("org.sqlite.JDBC");
              c = DriverManager.getConnection("jdbc:sqlite:test.db");
              c.setAutoCommit(false);
              System.out.println("Opened database successfully");
  
              stmt = c.createStatement();
  
              String sql = "INSERT INTO COMPANY VALUES(" + active + " ,
              '" + nam + "', " + ag + ")"; 
              stmt.executeUpdate(sql);
              c.commit();
  
              ResultSet rs = stmt.executeQuery( "SELECT * FROM COMPANY;"
             );
              while ( rs.next() ) {
                  int id = rs.getInt("id");
                  String  name = rs.getString("name");
                  int age  = rs.getInt("age");
                  System.out.println( "ID = " + id );
                  System.out.println( "NAME = " + name );
                  System.out.println( "AGE = " + age );
                  System.out.println();
              }
              rs.close();
              stmt.close();
              c.close();
          } catch ( Exception e ) {
              System.err.println( e.getClass().getName() + ": " + 
         e.getMessage() );
              System.exit(0);
          }
          System.out.println("Operation done successfully");
      }
      }
  </code></pre>