title: Cannot insert Nextval for SEQ in db2 using java
body: <p>I am trying to insert data into a db2 table using nextval for seq but I am getting the following errors in the log:</p>
  
  <pre><code>PreparedStatementnextval for maximo.REGION_SHEET_2GIDSEQ
  
  ERROR: [jcc][1091][10404][3.63.123] Invalid data conversion: Parameter instance nextval for maximo.REGION_SHEET_2GIDSEQ is invalid for the requested conversion. ERRORCODE=-4461, SQLSTATE=42815
  com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][1091][10404][3.63.123] Invalid data conversion: Parameter instance nextval for maximo.REGION_SHEET_2GIDSEQ is invalid for the requested conversion. ERRORCODE=-4461, SQLSTATE=42815
  
          at com.ibm.db2.jcc.am.fd.a(fd.java:679)
          at com.ibm.db2.jcc.am.fd.a(fd.java:60)
          at com.ibm.db2.jcc.am.fd.a(fd.java:103)
          at com.ibm.db2.jcc.am.hc.a(hc.java:744)
          at com.ibm.db2.jcc.am.hc.a(hc.java:664)
          at com.ibm.db2.jcc.am.hc.a(hc.java:1336)
          at com.ibm.db2.jcc.am.hc.a(hc.java:1306)
          at com.ibm.db2.jcc.am.io.a(io.java:2370)
          at com.ibm.db2.jcc.am.io.Bc(io.java:5586)
          at com.ibm.db2.jcc.am.io.l(io.java:2753)
  
  </code></pre>
  
  <p>I am passing the following string a variable an then calling it in a different class preparedstatement.</p>
  
  <p><code>String Region_Sheet_2gid = "nextval for maximo.REGION_SHEET_2GIDSEQ";</code></p>
  
  <p>Assigning above value to <code>REGION_SHEET_2GID</code> in below insert statement</p>
  
  <pre><code> public String getInsertStatement() {
      return "insert into maximo." +tablename+ " (SITECODE,BSCNAME,CITYNAME,REGION,VENDOR,TYPE"
          + ",NOOFCELLS,RBU,LATITUTE,LONGITUDE,LAC,SITENAME,ISACTIVE,PRIORITY,STATUS_2G_3G,REGION_SHEET_2GID,MORAN_SITES,DEODAR_SHARED,SITEPOWERPROFILETYPE,SITETYPE,OMC)"
          + " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
    }
  </code></pre>
  
  <p>PrepareStatement :
   <code>ps.setString(16, this.getREGION_SHEET_2GID());</code></p>
  
  <p>SettersGetter:</p>
  
  <pre><code>public String getREGION_SHEET_2GID() 
  
  {
      return REGION_SHEET_2GID;
  }
  </code></pre>
  
  <pre><code>public void setREGION_SHEET_2GID(String rEGION_SHEET_2GID) {
      REGION_SHEET_2GID = rEGION_SHEET_2GID;
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>