I'm trying to create a table with a list of names in it. This outputs:

> 
> "Failed to create table\_name"
> 
> 
> 

It was working before, I'm using Netbeans IDE with SQLite 3.7.2. I've also tried executing statements on the database which works fine. But it won't work through the Java code below

```
class DatabaseHelper{    
    public void addToDb(String tbname, List<String> name){
        try {
            String url = "jdbc:sqlite:D:/names.db";
            Class.forName("org.sqlite.JDBC");
            try(Connection conn = DriverManager.getConnection(url); 
                    Statement stmt = conn.createStatement();){
                stmt.execute("CREATE TABLE IF NOT EXISTS " + tbname + "(id integer PRIMARY KEY AUTOINCREMENT,"
                        + "name text NOT NULL)");

                name.forEach((s) -> {
                    try{
                        stmt.execute("INSERT INTO " + tbname + "(name) VALUES('" + s + "')");
                    }catch(SQLException e){
                        e.printStackTrace();
                    }
                });
                System.out.println("Finished");
            }catch(SQLException e){
                e.printStackTrace();
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}

```

EDIT : It does works, only takes to refresh it. No actual problems it seems