Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.PreparedStatementCreator


    final String origName = dlForm.getFileUpload().getOriginalFilename();
    final String ext = FilenameUtils.getExtension(origName);
    final String randomName = downloadFileService.generateRandomName()+"."+ext;
   
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
       
        String sql = "INSERT INTO " +quoteTable("download")+ "(filename, mask, remaining, date_added) VALUES(?,?,?,?) ";
View Full Code Here


  @Transactional
  @Override
  public void create(final BannerForm banner) {
   
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO " +quoteTable("banner")+ " SET name = ?, status = ?";
        PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

  private void addBannerImages(final BannerForm banner){
    if(banner.getImages().size()>0){
      for(final BannerImage image: banner.getImages()){
       
        KeyHolder keyHolder = new GeneratedKeyHolder();
        getJdbcOperations().update(new PreparedStatementCreator() {
          @Override
          public PreparedStatement createPreparedStatement(Connection con)
              throws SQLException {
            String sql = "INSERT INTO " +quoteTable("banner_image")+ " SET banner_id = ?, link = ?, image = ?";
            PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

  @Transactional
  @Override
  public void create(final LayoutForm layoutForm) {
   
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO " +quoteTable("layout") + "(name) VALUES(?)";
        PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

 
  @Transactional
  @Override
  public void create(final CategoryForm catForm) {
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO " +quoteTable("category")+ "(image, parent_id, top,"
          +quoteName("column")+",sort_order, status, date_added, date_modified) VALUES(?,?,?,?,?,?,?,?) ";
View Full Code Here

  @Transactional
  @Override
  public void create(final GeoZoneForm geoZone) {
   
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO "+quoteTable("geo_zone")+"(name, description, date_added) VALUES(?,?,?)";
        PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

        String sql = "INSERT INTO "+quoteTable("order_status")+"(order_status_id, language_id, name) VALUES(?, ?, ?)";
        getJdbcOperations().update(sql, orderStatusId,
            desc.getLanguageId(), desc.getName());
      }else{
        KeyHolder keyHolder = new GeneratedKeyHolder();
        getJdbcOperations().update(new PreparedStatementCreator() {
          @Override
          public PreparedStatement createPreparedStatement(Connection con)
              throws SQLException {
            String sql = "INSERT INTO "+quoteTable("order_status")+"(language_id, name) VALUES(?, ?)";
            PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

 
  @Transactional
  @Override
  public void create(final TaxClass taxClass) {
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO "+quoteTable("tax_class")+"(title, description, date_added) VALUES(?,?,?)";
        PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

  @Transactional
  @Override
  public void create(final LanguageForm lang) {
   
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO "+quoteTable("language")+"(name, code, locale, " +
            "directory, filename, image, sort_order, status) VALUES(?,?,?,?,?,?,?,?)";
View Full Code Here

  @Transactional
  @Override
  public void create(final VoucherThemeForm vtForm) {
   
    KeyHolder keyHolder = new GeneratedKeyHolder();
    getJdbcOperations().update(new PreparedStatementCreator() {
      @Override
      public PreparedStatement createPreparedStatement(Connection con)
          throws SQLException {
        String sql = "INSERT INTO "+quoteTable("voucher_theme")+" SET image = ?";
        PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.PreparedStatementCreator

Copyright © 2018 www.massapicom. 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.