Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.JdbcTemplate.update()


            String value = jdbcTemplate.queryForObject(
                    "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
            assertEquals("virattrcache", value);

            jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", userTO.getId());

            value = jdbcTemplate.queryForObject(
                    "SELECT USERNAME FROM testsync WHERE ID=?", String.class, userTO.getId());
            assertEquals("virattrcache2", value);
View Full Code Here


      cleanupAged ( ) ;
      JdbcTemplate jdbcTemplate = getJdbcTemplate ( ) ;

      try
      {
        jdbcTemplate.update ( _insertSQL, new Object[]
          { opUrl, nonce, now } ) ;
        return OK ;
      }
      catch ( DataIntegrityViolationException e )
      {
View Full Code Here

    {
      try
      {
        Date boundary = new Date ( System.currentTimeMillis ( ) - _maxAgeSeconds * 1000 ) ;
        JdbcTemplate jdbcTemplate = getJdbcTemplate ( ) ;
        int cnt = jdbcTemplate.update ( _deleteSQL, new Object[]
          { boundary } ) ;

        if ( _log.isDebugEnabled ( ) ) _log.debug ( "Client nonce cleanup removed " + cnt + " entries" ) ;
      }
      catch ( Exception e )
View Full Code Here

                String handle = Long.toHexString(_random.nextLong());

                Association association =
                        Association.generate(type, handle, expiryIn);

                int cnt = jdbcTemplate.update(sql,
                        new Object[] {
                                association.getHandle(),
                                association.getType(),
                                new String(Base64.encodeBase64(
                                        association.getMacKey().getEncoded())),
View Full Code Here

        {
            String sql = "DELETE FROM " + _tableName + " WHERE handle=?";

            JdbcTemplate jdbcTemplate = getJdbcTemplate();

            int cnt = jdbcTemplate.update(sql, new Object[] { handle } );

            if (cnt == 1 && DEBUG)
                _log.debug("Removed association, handle: " + handle);

            if (cnt != 1)
View Full Code Here

                String handle = Long.toHexString(_random.nextLong());

                Association association =
                        Association.generate(type, handle, expiryIn);

                int cnt = jdbcTemplate.update(sql,
                        new Object[] {
                                association.getHandle(),
                                association.getType(),
                                new String(Base64.encodeBase64(
                                        association.getMacKey().getEncoded())),
View Full Code Here

        {
            String sql = "DELETE FROM " + _tableName + " WHERE handle=?";

            JdbcTemplate jdbcTemplate = getJdbcTemplate();

            int cnt = jdbcTemplate.update(sql, new Object[] { handle } );

            if (cnt == 1 && DEBUG)
                _log.debug("Removed association, handle: " + handle +
                           " from table: " + _tableName);
View Full Code Here

        String sql = "DELETE FROM " + _tableName + " WHERE expdate<?";

            JdbcTemplate jdbcTemplate = getJdbcTemplate();

            Date now = new Date ( ) ;
            int cnt = jdbcTemplate.update(sql, new Object[] { now } );

            _log.debug("Cleaned " + cnt + " expired associations from table: "
                          + _tableName);

            _lastCleanup = System.currentTimeMillis();
View Full Code Here

  {   
    try
    {
      JdbcTemplate jdbcTemplate = getJdbcTemplate ( ) ;

      int cnt = jdbcTemplate.update ( _sqlDelete, new Object[]
        { opUrl, handle } ) ;
    }
    catch ( Exception e )
    {
      _log.error "Error removing association from table: "
View Full Code Here

   
    try
    {
      JdbcTemplate jdbcTemplate = getJdbcTemplate ( ) ;

      int cnt = jdbcTemplate.update ( _sqlInsert,
                      new Object[]
                        {
                           opUrl,
                          association.getHandle ( ),
                          association.getType ( ),
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.