public boolean updatePostGuid(long postId, final String guid) throws SQLException {
      Connection conn = null;
      PreparedStatement stmt = null;
      Timer.Context ctx = metrics.updatePostTimer.time();
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(updatePostGuidSQL);
         stmt.setString(1, guid);
         stmt.setLong(2, postId);
         return stmt.executeUpdate() > 0;
      } finally {
         ctx.stop();
         SQLUtil.closeQuietly(conn, stmt);
      }
   }
public boolean updatePostGuid ( long postId , final String guid ) throws SQLException { Connection conn = null ; PreparedStatement stmt = null ; Timer . Context ctx = metrics . updatePostTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( updatePostGuidSQL ) ; stmt . setString ( 1 , guid ) ; stmt . setLong ( 2 , postId ) ; return stmt . executeUpdate ( ) > 0 ; } finally { ctx . stop ( ) ; SQLUtil . closeQuietly ( conn , stmt ) ; } }
Updates the guid for a post.
@param postId The post to update.
@param guid The new guid.
@return Was the post modified?
@throws SQLException on database error or missing post id.