protected void setAll(PreparedStatement pstmt, int i, Field field) throws SQLException {
    double d;

    try {
      switch (field.getTypeFormat()) {
      case STRING:
        pstmt.setString(i, field.getBuffer());
        break;
      case INTEGER:
        d = Double.parseDouble(field.getBuffer()) * field.getCoefficient();
        pstmt.setInt(i, (int) d);

        break;

      case LONG:
        d = Double.parseDouble(field.getBuffer()) * field.getCoefficient();
        pstmt.setLong(i, (long) d);

        break;

      case FLOAT:
        d = Double.parseDouble(field.getBuffer()) * field.getCoefficient();
        pstmt.setFloat(i, (float) d);

        break;

      case DOUBLE:
        d = Double.parseDouble(field.getBuffer()) * field.getCoefficient();
        pstmt.setDouble(i, d);

        break;

      case DATETIME:

        if (field.getBuffer().equalsIgnoreCase("sysdate")) {
          pstmt.setTimestamp(i, new Timestamp(System.currentTimeMillis()));
        } else {
          SimpleDateFormat sdf = new SimpleDateFormat(field.getDateFormat());
          pstmt.setTimestamp(i, new Timestamp(sdf.parse(field.getBuffer()).getTime()));
        }

        break;
      case BLOB:
        String filename = field.getBuffer();
        File file = new File(filename);
        DataInputStream fis = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
        int l = (int) file.length();
        byte[] bytes = new byte[l];
        fis.read(bytes);
        pstmt.setBytes(i, bytes);
        fis.close();
        fis = null;
        file = null;
        bytes = null;
        break;
      default:
        throw new SQLException(field.getName() + " = " + field.getBuffer() + " type de champ du parametrage inconnu.");
      }
    } catch (Exception pe) {
      LOGGER.severe(ExceptionUtils.getStackTrace(pe));
      // new SQLException("String message", pe);
      throw new SQLException(field.getName() + " = '" + field.getBuffer() + "' " + pe.getMessage());
    }
  }