title: SQL injection on PostgreSQL
body: <p>My clienet(android) sends user details in the user form and my servlet just enters those details into to the database(postgre sql). I tried to give to do a sql injection attack by giving <code>;DELETE FROM tbl_name;</code> in the username field.<br>
  But postgresql just treats it as a value and enters it as the username. How do I do the SQLINjection attack. (I have not done any sort of checking in the postgre sql or the servlet).<br>Does it mean that postgresql is SQLInjection attack resistant? <br><br>
  I am using the following statements to insert the data:<br></p>
  
  <pre><code>String insert ="insert into userdetail(username,id,sno) values('"+username+"','"+userid+"','"+no+"')";
                     Statement stmt = conn.createStatement();
                      stmt.executeUpdate(insert);
  </code></pre>
  
  <p><br>
  The username contains <code>;DELETE FROM userdetail;</code>.<br>
  I have tried the following also:</p>
  
  <pre><code>');DELETE FROM userdetail;
  </code></pre>
  
  <p>But it fives the following error:</p>
  
  <pre><code>org.postgresql.util.PSQLException: ERROR: unterminat
  ed quoted string at or near "');"
    Position: 1
  </code></pre>
  
  <p><br>
  <br>I have also tried this:</p>
  
  <pre><code>','',');DELETE FROM userdetail;
  </code></pre>
  
  <p><br>
  This gives the following error:</p>
  
  <pre><code>17:36:46,828 INFO  [STDOUT] org.postgresql.util.PSQLException: ERROR: unterminat
  ed quoted string at or near "''');"
    Position: 38
  </code></pre>
  
  <p>but does not delete the records of the table. How do I make it delete the tables records?</p>