title: Java and SQLite [SQLITE_ERROR] SQL error or missing database ()
body: <p>I'm trying SQLite with Java, this is the first time using both together, here is the code:</p>
  
  <pre><code>package db;
  
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.Statement;
  
  /**
   *
   * @author Alessio
   */
  public class DB {
  
      public static void main(String[] args){
          Connection c = null;
          Statement stmt = null;
          try{
              Class.forName("org.sqlite.JDBC");
              c = DriverManager.getConnection("jdbc:sqlite:test.db");
              stmt = c.createStatement();
              String sql = "CREATE TABLE COMPANY " +
                     "(ID INT PRIMARY KEY     NOT NULL," +
                     " NAME           TEXT    NOT NULL, " + 
                     " AGE            INT     NOT NULL, " + 
                     " ADDRESS        CHAR(50), " + 
                     " SALARY         REAL)"; 
              stmt.executeUpdate(sql);
              stmt.close();
              c.close();
          }
          catch(Exception e){
              System.err.println(e.getClass().getName() + ": " + e.getMessage());
              System.exit(0);
          }
          System.out.println("Database opened succesfully!!!");
      }
  
  }
  </code></pre>
  
  <p>When I run the code for the first time I have any error, my result in console is:</p>
  
  <pre><code>run:
  Database opened succesfully!!!
  BUILD SUCCESSFUL (total time: 1 second)
  </code></pre>
  
  <p>while the second time I get</p>
  
  <pre><code>run:
  java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database ()
  BUILD SUCCESSFUL (total time: 1 second)
  </code></pre>
  
  <p>What am I doing wrong?</p>