title: java.sql.SQLException: statement is not executing
body: <p>I am trying to create a simple SQLite database program that could create a database, a table, insert and retrieve data. How can I fix this? I keep getting the exception:</p>
  
  <blockquote>
    <p>java.sql.SQLException: statement is not executing</p>
  </blockquote>
  
  <pre><code>package databaseproj;
  
  import java.sql.*;
  
  public class main {
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          try{
              String sDriverName = "org.sqlite.JDBC";
              Class.forName(sDriverName);
              String dbURL= "jdbc:sqlite:hello.db";
  
              Connection conn= DriverManager.getConnection(dbURL);
              Statement st= conn.createStatement();
  
              String createtable="CREATE TABLE contacts(name text, number numeric, email text)";
              System.out.println("Table created successfully");
              String insertcontacts="INSERT INTO contacts(name, number, email) VALUES('nduka',08166459353,'ndukaude')";
  
              st.executeUpdate(createtable);
              st.executeUpdate(insertcontacts);
              System.out.println("Insert complete");
  
              ResultSet rs= st.getResultSet(); 
  
              conn.setAutoCommit(false);
              while ( rs.next() ){
                  String name= rs.getString("name");
                  int num=rs.getInt("number");
                  String email=rs.getString("email");
  
                  System.out.println("NAME: "+name);
                  System.out.println("NUMBER: "+ num);
                  System.out.println("EMAIL: "+email);
              }
  
              conn.commit();
              conn=null;
              System.out.println("connection emptied");
              rs.close();
  
              st.close();
  
              conn.close();
              System.out.println("connection closed");
          }
  
          catch ( Exception e ) {
              System.err.println( e.getClass().getName() + ": " + e.getMessage() );
              System.exit(0);
          }
      }
  }
  </code></pre>