title: Insert if not exists into table
body: <p>I want do an INSERT into table IF NOT EXISTS</p>
  
  <p>So I have 2 <code>JTextField</code>s and I want add the variables that i st into <code>JTextfield</code>s int table but in condition that they are not exists in table </p>
  
  <p>This is the code and it gives me errors about the query:</p>
  
  <pre><code>try{
      Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+db, "root", "123456");
         stmt = conn.createStatement();
         stmt.executeUpdate(
             "insert into router (edge01,edge02)\n" +
             "Select edge01, edge02 " +
             "Where not exists(select * from router " +
                              "where edge01='" + jTextField1.getText() +
                                "' and edge02='" + jTextField2.getText() + "')");
  }
  catch (SQLException ex) {
      Logger.getLogger(bdd.class.getName()).log(Level.SEVERE, null, ex);
  }
  </code></pre>
  
  <p>Error:</p>
  
  <p><code>SEVERE: null<br>
  com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Where not exists(select * from router where edge01='fffffffff' and edge02='fffff' at line 2</code></p>