Package org.springframework.jdbc.core.namedparam

Examples of org.springframework.jdbc.core.namedparam.MapSqlParameterSource.addValue()


            insertSql = insertSql.substring(0, re) +":histId, :histOperation, CURRENT_TIMESTAMP, :histUserId," +insertSql.substring(re);
   
            insertHistorySql = insertSql;
          }
          params.addValue("histId",0);
          params.addValue("histOperation", operation);
          params.addValue("histStamp","");
          params.addValue("histUserId", (String)params.getValue("userId"));
          insert("__insertHistory", insertHistorySql, params, original);
        } catch (Throwable e) {
          logger.warn("Failed to insert history!", e);
View Full Code Here


   
            insertHistorySql = insertSql;
          }
          params.addValue("histId",0);
          params.addValue("histOperation", operation);
          params.addValue("histStamp","");
          params.addValue("histUserId", (String)params.getValue("userId"));
          insert("__insertHistory", insertHistorySql, params, original);
        } catch (Throwable e) {
          logger.warn("Failed to insert history!", e);
        }
View Full Code Here

            insertHistorySql = insertSql;
          }
          params.addValue("histId",0);
          params.addValue("histOperation", operation);
          params.addValue("histStamp","");
          params.addValue("histUserId", (String)params.getValue("userId"));
          insert("__insertHistory", insertHistorySql, params, original);
        } catch (Throwable e) {
          logger.warn("Failed to insert history!", e);
        }
      }
View Full Code Here

               
                for (String f: placeholders) {
                    try {
                        if (! r.has(f) || r.get(f).getValue() == null) {
                            // Handle undefined or null-valued fields by simply adding null                           
                            p.addValue(placeholderMap.get(f), null);
                        } else {
                            if (typeMap.get(f).equals(java.sql.Types.NUMERIC)) {
                                try {
                                    p.addValue(placeholderMap.get(f), Long.valueOf(r.get(f).getValue()),
                                            java.sql.Types.NUMERIC);
View Full Code Here

                            // Handle undefined or null-valued fields by simply adding null                           
                            p.addValue(placeholderMap.get(f), null);
                        } else {
                            if (typeMap.get(f).equals(java.sql.Types.NUMERIC)) {
                                try {
                                    p.addValue(placeholderMap.get(f), Long.valueOf(r.get(f).getValue()),
                                            java.sql.Types.NUMERIC);
                                } catch (NumberFormatException ex) {
                                    // Parse to big decimal as a fallback option
                                    p.addValue(placeholderMap.get(f), new java.math.BigDecimal(r.get(f).getValue()),
                                            java.sql.Types.NUMERIC);
View Full Code Here

                                try {
                                    p.addValue(placeholderMap.get(f), Long.valueOf(r.get(f).getValue()),
                                            java.sql.Types.NUMERIC);
                                } catch (NumberFormatException ex) {
                                    // Parse to big decimal as a fallback option
                                    p.addValue(placeholderMap.get(f), new java.math.BigDecimal(r.get(f).getValue()),
                                            java.sql.Types.NUMERIC);
                                }
                            }
                            else {
                                p.addValue(placeholderMap.get(f), r.get(f).getValue(), typeMap.get(f)) ;
View Full Code Here

                                    p.addValue(placeholderMap.get(f), new java.math.BigDecimal(r.get(f).getValue()),
                                            java.sql.Types.NUMERIC);
                                }
                            }
                            else {
                                p.addValue(placeholderMap.get(f), r.get(f).getValue(), typeMap.get(f)) ;
                            }
                        }
                    } catch (NullPointerException ex) {
                        log.warn("Target SQL placeholder '" + f + "' refers to a nonexistent field.");
                        p.addValue(placeholderMap.get(f), null);
View Full Code Here

                                p.addValue(placeholderMap.get(f), r.get(f).getValue(), typeMap.get(f)) ;
                            }
                        }
                    } catch (NullPointerException ex) {
                        log.warn("Target SQL placeholder '" + f + "' refers to a nonexistent field.");
                        p.addValue(placeholderMap.get(f), null);
                    }
                }
               
                parameters.add(p);
            } catch (NumberFormatException ex) {
View Full Code Here

    this.template = template;
  }

  public long save(PrintJob printJob) throws IOException {
    MapSqlParameterSource params = new MapSqlParameterSource();
    params.addValue("printServiceName", printJob.getPrintService().getName())
            .addValue("printDate", printJob.getPrintDate())
            .addValue("jobCreator_userId", printJob.getPrintUser().getUserId())
            .addValue("status", printJob.getStatus());

    Blob barcodeBlob = null;
View Full Code Here

    Blob barcodeBlob = null;
    try {
      if (printJob.getQueuedElements() != null) {
        byte[] rbytes = LimsUtils.objectToByteArray(printJob.getQueuedElements());
        barcodeBlob = new SerialBlob(rbytes);
        params.addValue("printedElements", barcodeBlob);
      }
      else {
        params.addValue("printedElements", null);
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.