Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.PreparedStatementCreator


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


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

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

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

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

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

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

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

    };
   
    protected byte[] getSerializedState(HttpServletRequest request, final String id) throws Exception
    {
        return (byte[])jdbcOperations.query(
                new PreparedStatementCreator()
                {
                    public PreparedStatement createPreparedStatement(Connection con)
                    throws SQLException
                    {
                        PreparedStatement statement = con.prepareStatement(
View Full Code Here

    protected String storeSerializedState(HttpServletRequest request, final byte[] state) throws Exception
    {
        final int rnd = random.nextInt();
        KeyHolder keyHolder = new GeneratedKeyHolder();
        jdbcOperations.update(
                new PreparedStatementCreator()
                {
                    public PreparedStatement createPreparedStatement(Connection con)
                    throws SQLException
                    {
                        PreparedStatement statement = con.prepareStatement(
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.