title: No value specified for parameter 1
body: <p>I am using <strong>Hiberante</strong> to connect to <strong>postgres</strong> database. I am trying to insert a record into the database. I have the values for the record in a string array which I got from a csv file. This is my dao code</p>
  
  <pre><code>StringBuffer query=new StringBuffer("insert into t_wonlist values(");
          for(int i=0;i&lt;67;i++){
              query.append(values[i]+",");
          }
          query.deleteCharAt(query.lastIndexOf(","));
          query.append(");");
  
          sessionfactory.getCurrentSession().createSQLQuery(query.toString()).executeUpdate();
          System.out.println("Query executed");
          sessionfactory.getCurrentSession().flush();
  </code></pre>
  
  <p>I am using StringBuffer, so that I can append the values into the query using a for loop. </p>
  
  <p>but when I execute the query I am getting the following exception</p>
  
  <pre><code> org.postgresql.util.PSQLException: No value specified for parameter 1.
  </code></pre>
  
  <p>I am sure that the number of parameters is correct. Can someone help me. Thanks</p>